Hi,
Thank you for pointing that out, that does indeed do what I want
mostly. However, while the data is autoscaled to the plot, the values
on the y axis are not updated and they remain at their original
values. I suspect this is because I am not giving a command to redraw
the axes. How would I go about doing that? I think I need to blit a
larger bbox that encompasses the axes as well, but I'm not sure how to
get that.
By the way, I found that self.ax1.autoscale_view(scalex=False, scaley
= True) seems to autoscale just the y axis and seems clearer than the
set_ylim code suggested below.
Thanks again,
Glenn

On 4/26/08, John Hunter <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 25, 2008 at 1:19 AM, G Jones <[EMAIL PROTECTED]> wrote:
>  > Hello,
>  >  Thank you for the suggestion. However, I am refering to the
>  >  canvas.restore_region, draw_artist, blit, gui_repaint sort of
>  >  animation.
>  >  Glenn
>
>
> His suggestion is still correct -- after you update the line data and
>  before you call draw_artist, you can acll relim and autoscale_view as
>  Mattias suggested.  However, this will not always do what you want,
>  because it will autoscale both the x and the y.  In animated plots,
>  often you are just updating the ydata an want to manually control the
>  xlim and autoscale the ylim (eg strip charting).  In that case, I
>  would do :
>
>         self.ax1.relim()
>         self.ax1.set_ylim(*self.ax1.yaxis.major.locator.autoscale())
>
>   JDH
>

-------------------------------------------------------------------------
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