From: Sandro T. <mo...@de...> - 2009-05-13 17:15:58
|
Hi John, On Tue, May 12, 2009 at 22:55, John Hunter <jd...@gm...> wrote: > If you change the data directly, and want mpl to autoscale, you need > to call ax.relim() before calling ax.autoscale_view(). mpl stores the > min/max of the data you add to it when you add the lines, rectangles, > etc to the figure. When you update the data directly, there is no > internal mechanism to notify the limits to update (we could add this > but haven't). So you must explicitly call relim, which tells mpl to > reinspect the data recalculate the limits. It might be a better > design to have each artist store its limits, updating them when data > is updated, and then having the container artists, eg the Axes, do a > union of the child bboxes. But this is not the design we have > currently. Ahhh, relim() - that's what I was missing! :) Well, now that I've tried with relim(), I don't know it the result is better or not :S I'm attaching the screenshots here for comments (if there's any): 1 is with xlim/ylim set to max of datapoints, 2 is with relim and ax.autoscale_view() Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi |