> The problem here is probably with the blitting. You make a copy of the > background before plotting the data. Before you plot the data, the axes > have no clue what's its limits are supposed to be. In your example, it > won't know until you do the plotting. Then when you restore the > background, it is restoring the background that never knew the limits. > > I suggest calling ax.set_xlim() and ax.set_ylim() before doing the > copy_from_bbox(). > > I hope that helps, > Ben Root > >
Thank you very much Ben Root for your prompt response and valuable assistance! Now I can set the limits using set_ylim. I call it just before self.restore_region(...). But I should calculate limits myself in order to provide them to that function. In my case it looks like this: y1 = np.sin(self.x+self.cnt/10.0) y2 = (self.x+self.cnt)/50.0 self.ax.set_ylim(min(y1.min(), y2.min()), max(y1.max(), y2.max())) another way I've discovered is to call plot() function in every step. But this approach is little slowly the difference is about 5%. ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users