Hello,
I am again working on an application with animated plots using the
blitting method. I am using the Qt4 backend, but I had similar trouble
with the wx backend. The trouble is when I first get the bbox of the
plot to copy the background region, the bbox is incorrect, so the
wrong region is used for updating. I have added a resize event handler
(below) that works well. As soon as I resize the application the
graphs look fine. I have tried calling all of the following before
accessing the bbox to try and force the application to get to an
appropriate layout:
        self.update()
        self.repaint()
        self.layout()
        QApplication.processEvents()
        QApplication.processEvents()
        QApplication.flush()
I also plot a set of data that has the same x and y range as the
animated data, so I know the axis limits are not changing. When I
print the initial bbox, I get 30,15,270,285 and when I print it after
resizing, I get 30.8, 22, 277,417 which makes much more sense.
Here is the resize event handler:
        self.update()
        self.total_bbox = self.SpecPlotA
        print self.total_bbox
        self.bkg = self.SpecCanvas.copy_from_bbox(self.total_bbox)
Any ideas of how to get the initial plot to work?
Thanks
Glenn

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to