|
From: Darren D. <dar...@co...> - 2007-10-20 16:15:11
|
On Friday 19 October 2007 06:16:14 pm Darren Dale wrote: > On Friday 19 October 2007 05:23:38 pm Darren Dale wrote: > > I'm having some trouble updating a plot window without calling plot. I > > would like to do something like: > > > > ax = axes() > > lines, = plot([1,2,3], [1,2,3]) > > lines.set_ydata([4,5,6]) > > ax.autoscale_view() > > ax.draw() > > > > The line does get updated, but the axes limits are not updated. I've > > looked into the Axes.plot code, and as far as I can tell, the above code > > should work. Can anyone tell me what is the right way to do this? Here is the answer: ax = axes() lines, = plot([1,2,3], [1,2,3]) lines.set_ydata([4,5,6]) ax.relim() ax.autoscale_view() ax.draw() |