toolbar issues

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:

OK, could you resend a patch against CVS?

It is attached. There are two comments-questions in the patch,
please delete them after reading.
And at the end of this patched legend() method there is a line
handles = flatten(handles)
If handles are not already flat, I think something may go wrong
earlier in this method (?).

    > 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

Thanks for explaination. I guessed it works like this after finding
what 'hold' is in Matlab. I just meant to say that such explaination
could be helpful in mpl documentation.

    > 2. something like wxPython demo,
    > that contains all the examples

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?

Yes, I've seen all the examples and they are very useful. However wxPython
demo is more useful than just a set of examples: examples are grouped
in categories, every example has a detailed documentation about
introduced features. From wx demo overview:

"""
This demo is not only a collection of test cases for wxPython, but is also
designed to help you learn about and how to use wxPython. Each sample is
listed in the tree control on the left. When a sample is selected in the
tree then a module is loaded and run (usually in a tab of this notebook,)
and the source code of the module is loaded in another tab for you to
browse and learn from.
"""

Marcin

nolegend.diff (1.89 KB)

···

On Thu, 5 May 2005, John Hunter wrote:

--
Marcin Wojdyr | http://www.unipress.waw.pl/~wojdyr/