Le vendredi 17 juin 2011 à 02:38 -0700, Alain Francés a écrit : > Hi, > > This way the code creates empty images, it needs indeed some update where > you inserted the comment. However I'm not sure that the benefit in > term of memory and speed will be important.
I would think it would avoid creating a new instance of AxesImage and calling garbage collector to destroy previous one (if no reference is kept) or accumulating children of the figure (if reference to previous AxesImages is kept by a parent object). Update is done by fig.canvas.draw() (to be put where the comment is) > PS: I slightly changed the code below since as Jakob noticed: "since you > just use one figure object and don't switch it it is not necessary to pass > the object to the plot method - it remains active anyway." You can in fact remove the fig argument of the plot_density function as it is not used. The clf command removes the children of the figure so that it has to delete the axes and its children (amongst which is the AxesImage) and create new ones when you invoke imshow again. -- Fabrice Silva ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users