I don't like the idea of making the label a string or None,
>> because it leads to code that is difficult to maintain and may
>> break existing code that relies on the label to be a string. I
>> would be amenable to using a sentinel string, such as
>> '_nolegend_' or something like that.
> Ok, it would also work well for me.
OK, could you resend a patch against CVS?
> BTW when I was reading mpl docs I stopped for a while on
> description of 'hold'. I'm not used to Matlab and didn't
> understand what is "hold state". (I found it out in
> Matlab docs).
When hold is True, subsequent plot commands will be added to the
current axes. When hold is False, the current axes and figure
will be cleared on the next plot command
There are many ways to manipulate the hold state. You can call the
pylab (or Axes) "hold" function with a boolean. You can pass hold as
a kwarg to a plot command to temporarily override the default. And
you can set the default value in your rc file.
For example, suppose you have hold=False in rc. Then every plot
command will clear the previous one. But you may want to add a new
overplot
plot([1,2,3])
plot([2,4,6], hold=True) # overplot
The default rc file that ships with matplotlib already has hold : True
be default (matlab is hold False by default).
You can query the hold state with ishold.
> And if I could say what features I'm lacking most in MPL,
> it would be: 1. plotting a function like in, say, gnuplot,
> without using arange() 2. something like wxPython demo,
> that contains all the examples
1) Would definitely be nice -- we've talked about it.
2) Have you seen the examples directory in the matplotlib src
distribution, and is also available here
http://matplotlib.sourceforge.net/matplotlib_examples_0.80.zip ?
Or do you mean something else?
JDH
···
On Wed, 4 May 2005, John Hunter wrote: