marker=None not allowed?

Line2D documentation reads:

    marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4'

1. Minor documentation bug: missing end bracket
2. Why is marker=None no longer allowed?

Cheers,
Alan Isaac

Alan G Isaac wrote:

Line2D documentation reads:

    marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4'

1. Minor documentation bug: missing end bracket

Sort of. Actually, what is also missing is a very long list of possible markers, as given in the docstring for the set_marker method. Some docstring modifications and consolidations are needed.

2. Why is marker=None no longer allowed?

marker='None' is allowed, as is ' ' and ''. Do you need None? The idea is to distinguish between 'None' as in 'no marker--don't draw anything', and None as the default for a kwarg, meaning use the rcParams value. In plot, if you trace through the chain of half a dozen or so functions, you find that the kwargs are handled using setters, not at the stage of initialization of the Line2D instance, and setters generally don't accept None.

Eric

···

Cheers,
Alan Isaac

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I recently returned to some old figures where I did things
like this:

ls1 = dict(linestyle='-', marker=None, color=(0,0,1), linewidth=2, zorder=1000)
fig_ax.plot_date(dates, data, **ls1)

This now fails with a KeyError.

However changing to marker='' works fine.
I find that a bit less intuitve than marker=None,
but I understand you to say that this should mean "use the default".

Thank you,
Alan Isaac

···

On Fri, 31 Aug 2007, Eric Firing apparently wrote:

marker='None' is allowed, as is ' ' and ''. Do you need None?

Alan G Isaac wrote:

marker='None' is allowed, as is ' ' and ''. Do you need None?

I recently returned to some old figures where I did things like this:

ls1 = dict(linestyle='-', marker=None, color=(0,0,1), linewidth=2, zorder=1000)
fig_ax.plot_date(dates, data, **ls1)

This now fails with a KeyError.

However changing to marker='' works fine.
I find that a bit less intuitve than marker=None,
but I understand you to say that this should mean "use the default".

Yes, I think that quite some time ago we discussed this and decided to use the string "None" as well as empty strings, and to reserve the Python None for "use the default". I believe it was originally in the context of color specifications, and we then extended it to be a general convention. What is inconsistent is that in some cases one can explicitly use, e.g., marker=None for the default and in other cases, such as the plot command, one cannot. It is a question of whether the kwargs are being passed directly to the initializer or whether they are being applied after initialization via setters. I don't think it would be difficult to remove this inconsistency, and maybe it is worth doing. I'm not inspired to do it immediately, though. Certainly the question should be addresses if the API is redone using traits.

Eric

···

On Fri, 31 Aug 2007, Eric Firing apparently wrote: