Opened 9 years ago
#48 new defect
Hidden plot raises ValueError
Reported by: | flip | Owned by: | flip |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | general/unknown | Version: | |
Keywords: | Cc: | bsoher |
Description
So far, I've recreated this on OS X but haven't been able to on Windows (and haven't tried Linux). This might be specific to a given wx implementation.
- Open a dataset
- On the basic tab, slide the slider all the way to the right so that the plot is hidden.
- move to spectral tab
- move back to basic. Python raises this error:
Traceback (most recent call last): File "/Users/me/w/duke/src/vespa/analysis/src/notebook_datasets.py", line 84, in on_tab_changed self.active_tab.on_tab_changed() File "/Users/me/w/duke/src/vespa/analysis/src/tab_dataset.py", line 387, in on_tab_changed tab.process_and_plot() # update the plots File "/Users/me/w/duke/src/vespa/analysis/src/tab_basic.py", line 658, in process_and_plot self.plot(set_scale=set_scale) File "/Users/me/w/duke/src/vespa/analysis/src/tab_basic.py", line 764, in plot self.view.canvas.draw() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_wxagg.py", line 61, in draw self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_wxagg.py", line 163, in _convert_agg_to_wx_bitmap agg.buffer_rgba(0, 0)) File "/usr/local/lib/wxPython-unicode-2.8.12.0/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_gdi.py", line 886, in BitmapFromBufferRGBA return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer) ValueError: Invalid data buffer size.
I think the problem is due to the plot being completely hidden, so the canvas size is (0, 0) or something like that.
What's even more annoying than the error printed to the console is that the slider/gripper has disappeared completely and I can't figure out how to reveal it again without closing and re-opening the dataset.
Under Windows, when I do the same the gripper doesn't disappear and there's always a little sliver of the plot visible. That avoids both problems described above. We might want to implement something like that ourselves, or sanity check the slider values when a tab is activated, or just live with it.