From: Mark H. <ao...@ds...> - 2004-08-25 04:27:27
|
Hi, > I'm getting access violations while resizing the window/splitters of the > attached script. The problem is intermittant. BTW, the embedding_in_wx4 example (among others) exhibits the same problem for me. I can always reproduce it by launching and resizing the window from small to large, without ever releasing the mouse button. This usually crashes within 10 resizes or so, but as with your description it's intermittent, it can take longer. This is with Windows XP, Python 2.3.4, matplotlib 0.61.0, wxPython 2.5.2.7. It was also present in the last matplotlib and wxPython releases at least. I seem to remember the plain wx frontend also being flaky under this kind of 'abuse', but I can't seem to get that to break now. I also notice that you get a shear effect on some of the resizes (where the plot is drawn as a parallelogram). That's reproducible by shrinking the plot very small, but also occasionally happens at other sizes. I can't be sure whether the size/aspect ratio of the window causes that. |
From: John H. <jdh...@ac...> - 2004-08-25 17:18:11
|
>>>>> "Mark" == Mark Howson <ao...@ds...> writes: Mark> BTW, the embedding_in_wx4 example (among others) exhibits Mark> the same problem for me. I can always reproduce it by Mark> launching and resizing the window from small to large, Mark> without ever releasing the mouse button. This usually Mark> crashes within 10 resizes or so, but as with your Mark> description it's intermittent, it can take longer. This is Mark> with Windows XP, Python 2.3.4, matplotlib 0.61.0, wxPython Mark> 2.5.2.7. It was also present in the last matplotlib and Mark> wxPython releases at least. I seem to remember the plain wx Mark> frontend also being flaky under this kind of 'abuse', but I Mark> can't seem to get that to break now. Mark> I also notice that you get a shear effect on some of the Mark> resizes (where the plot is drawn as a parallelogram). That's Mark> reproducible by shrinking the plot very small, but also Mark> occasionally happens at other sizes. I can't be sure whether Mark> the size/aspect ratio of the window causes that. Thanks for the bug reports, I thing the crash and the shear effect are both part of the same bug that arose from a floating point error in converting figure units to width and height. I believe this is a simple fix. I was able to replicate both of the buggy behaviors on my winxp box, and the following change fixed both. Perhaps you and Heiko can test on your respective scripts and let me know. On site-packages/matplotlib/backends/backend_wxagg.py, replace FigureCanvasWXAgg.draw with def draw(self): """ Render the figure using agg """ DEBUG_MSG("draw()", 1, self) FigureCanvasAgg.draw(self) s = self.tostring_rgb() w = int(self.renderer.width) h = int(self.renderer.height) image = wxEmptyImage(w,h) image.SetData(s) self.bitmap = image.ConvertToBitmap() self.gui_repaint() Let me know! Know if I can just figure out why there is the irritating flicker on resizes in win32.... JDH |
From: Heiko H. <he...@hh...> - 2004-08-25 19:39:35
|
John Hunter wrote: >Thanks for the bug reports, > >I thing the crash and the shear effect are both part of the same bug >that arose from a floating point error in converting figure units to >width and height. I believe this is a simple fix. I was able to >replicate both of the buggy behaviors on my winxp box, and the >following change fixed both. Perhaps you and Heiko can test on your >respective scripts and let me know. > >On site-packages/matplotlib/backends/backend_wxagg.py, replace >FigureCanvasWXAgg.draw with > > def draw(self): > """ > Render the figure using agg > """ > DEBUG_MSG("draw()", 1, self) > > FigureCanvasAgg.draw(self) > s = self.tostring_rgb() > w = int(self.renderer.width) > h = int(self.renderer.height) > image = wxEmptyImage(w,h) > image.SetData(s) > self.bitmap = image.ConvertToBitmap() > self.gui_repaint() > >Let me know! > >Know if I can just figure out why there is the irritating flicker on >resizes in win32.... > >JDH > > > >------------------------------------------------------- >SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media >100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 >Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. >http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 >_______________________________________________ >Matplotlib-users mailing list >Mat...@li... >https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > Hello John, I tested the fix and the problem seems to be gone. I will continue the testing and will let you know in case I will find anything else. Thank you for your fast response and for the great library.. Heiko |
From: Mark H. <ao...@ds...> - 2004-08-26 01:03:53
|
Hi, > I thing the crash and the shear effect are both part of the same bug > that arose from a floating point error in converting figure units to > width and height. I believe this is a simple fix. I was able to > replicate both of the buggy behaviors on my winxp box, and the > following change fixed both. Perhaps you and Heiko can test on your > respective scripts and let me know. I can confirm that this fix works for me too. Thanks, that's a big help! > Know if I can just figure out why there is the irritating flicker on > resizes in win32... The flicker doesn't seem so bad to me, to be honest. It seemed worse because I was using embedding_in_wx4 (which has an extra EVT_PAINT redraw). Mark |