JD83, on 2011-07-13 08:59,  wrote:
> 
> I am writing a script with a matplotlib figure embedded in a Tkinter Frame :
> 
> fig=Figure()
> ax=fig.add_subplot(111)
> canvas = FigureCanvasTkAgg(fig, root)
> 
> and so on...
> 
> Everything goes well but when i try to clear the figure, the xaxis and yaxis
> don't desappear, so that the next axis print over the previous ones.
> 
> ax.cla() clears the plot.
> But ax.xaxis.cla() or ax.yaxis.cla() have no effect.

as far as i can see, this is for resetting the formatting and
clearing labels - it does have an effect here:
In [16]: ax.set_ylabel("foo")
Out[16]: <matplotlib.text.Text at 0xb25a44c>

In [17]: ax.yaxis.cla() #label is gone

> And fig.clr() seems to lock the process : nothing deleted, nothing new
> ploted.

Try this:
f.clf(keep_observers=False)

from the docstring: "Set *keep_observers* to True if, for example,
a gui widget is tracking the axes in the figure."

best,
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to