From: <fcc...@fi...> - 2005-02-14 11:12:54
|
On Saturday 12 February 2005 23:40, John Hunter wrote: > >>>>> "Fl=E1vio" =3D=3D Fl=E1vio Code=E7o Coelho <fcc...@fi...> wr= ites: > > Fl=E1vio> hi, how can I remove a colorbar? > > Fl=E1vio> in the following code, i generate figures that are saved > Fl=E1vio> not shown. and with every new figure I get an extra > Fl=E1vio> colorbar instead of an updated one! > > Hi Flavio, > > Try clearing the figure between saves with clf. Or else manage the > different figures the "figure" and "close" commands. > > The default mode of matplotlib is to continue adding stuff to the same > figure, so you need to clear axes with "cla", clear figures with > "clf", close figures with "close", create new figures with "figure", > and manage the hold state with "hold", "ion", "ioff" and "ishold". > See the documentation for all of these commands at > http://matplotlib.sf.net/matplotlib.pylab.html > > Hope this helps, > JDH > Thanks John, I just want to let you know that neither 'cla', 'clf' nor 'figure' solved t= he=20 issue but 'close' did it. I must point out that the only element that was= =20 being carried out from figure to figure was the colorbar, not the plot=20 itself. Apparently 'close' is the only one of these functions that gets rid= =20 of the colorbar. =46l=E1vio=20 |