Hi Eric,
I didn't intend to be faster or more memory saving than clearing the axes but
to preserve the properties of the axes (like the label in my example).
What are the advantages of using 'cla' instead of deleting old collections?
Kind regards,
Matthias
PS: The following works as the previous example, but using 'cla':
ax = plt.subplot(111)
for i in xrange(10):
x = np.random.uniform(size=(20, 20)) # get some random data
ax.contour(x)
plt.draw() # redraw current figure
time.sleep(1) # wait for one second
ax.cla() # clear the axes
On Monday 28 September 2009 21:15:05 Eric Firing wrote:
> Matthias Michler wrote:
> > Hi Ralph,
> >
> > I don't think there exists a function like the line-'set_data'-method for
> > collections, which are generated by 'contour'. This particular method of
> > lines only changes the data but leave anything else unchanged.
> > I attached an easy approach of updating a contour plot (simply deleting
> > old collections), but I'm not sure that this is the best solution.
>
> I don't think you area gaining anything at all by manually deleting the
> collections. Better to just clear the axes, or clear the figure, and
> make a fresh plot.
>
> Eric
>
> > Kind regards,
> > Matthias
> >
> > On Monday 28 September 2009 13:52:42 Ralph Kube wrote:
> >> Hi,
> >> is there a way to update a contour plot? I need to display a series of
> >> contour plots from a directory with data files and want to view them
> >> consecutively, preferrably without building a gui for it. Is there an
> >> easy way out?
> >>
> >> Cheers, Ralph
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users