plt.plot projection kwarg

The first line of code on the page
http://matplotlib.sourceforge.net/devel/add_new_projection.html suggests
that it is possible to give the projection directly to mpl.pyplot.plot but
this does not work for me.

Should this functionality exist? I am aware that the pyplot.plot function is
autogenerated by boilerplate.py, but I am a little weary of modifying that.

Any help gratefully received.

···

--
View this message in context: http://old.nabble.com/plt.plot-projection-kwarg-tp31772544p31772544.html
Sent from the matplotlib - devel mailing list archive at Nabble.com.

Hmm, this doesn’t seem 100% logically correct. I think the only case where this would work correctly is if the plot command would also trigger the creation of a new axes object. If the axes object already exists, then I seriously doubt this would work as advertised. Is that the case with your code?

Ben Root

···

On Sat, Jun 4, 2011 at 9:09 AM, Phil Elson <philipelson@…968…6…> wrote:

The first line of code on the page

http://matplotlib.sourceforge.net/devel/add_new_projection.html suggests

that it is possible to give the projection directly to mpl.pyplot.plot but

this does not work for me.

Should this functionality exist? I am aware that the pyplot.plot function is

autogenerated by boilerplate.py, but I am a little weary of modifying that.

Any help gratefully received.

Ben,

The first paragraph of that doc page needs repair. Trivially, there are two references to set_xscale. The problem pointed out above is more serious. plot() has no facility for handling a projection kwarg, and I don't think it would make sense to try to add one. pyplot functions that accept the projection kwarg are axes, subplot, and subplots.

Do you want to fix the paragraph, or should I?

Independently, I want to redo the FAQ discussion of draw(), show(), and interactive versus non-interactive mode. It is possible that this topic needs more attention elsewhere as well, but I want to start with the FAQ.

Eric

···

On 06/04/2011 06:05 AM, Benjamin Root wrote:

On Sat, Jun 4, 2011 at 9:09 AM, Phil Elson <philipelson@…476… > <mailto:philipelson@…476…>> wrote:

    The first line of code on the page
    http://matplotlib.sourceforge.net/devel/add_new_projection.html suggests
    that it is possible to give the projection directly to
    mpl.pyplot.plot but
    this does not work for me.

    Should this functionality exist? I am aware that the pyplot.plot
    function is
    autogenerated by boilerplate.py, but I am a little weary of
    modifying that.

    Any help gratefully received.

Hmm, this doesn't seem 100% logically correct. I think the only case
where this would work correctly is if the plot command would also
trigger the creation of a new axes object. If the axes object already
exists, then I seriously doubt this would work as advertised. Is that
the case with your code?

Ben Root

I think the only case where this would work correctly is if the plot command would also trigger the creation of a new axes object.
Can’t see how this can ever happen given the pyplot.plot code, which creates a standard axes without passing through any arguments.

I agree that there are situations when it doesn’t make sense to define the projection when doing a plt.plot, maybe best to fix the projections documentation instead of providing a keyword which is not always valid. Either that, or plt.plot with a projection always makes a new axes?

Attempting to pass the projection currently to plot results in an exception:

···

plt.plot(range(10), projection=‘polar’)

TypeError: There is no line property “projection”

Independently, I want to redo the FAQ discussion of draw(), show(), and
interactive versus non-interactive mode. It is possible that this topic
needs more attention elsewhere as well, but I want to start with the FAQ.

I think I will move the "show" section entirely out of howto and put the revision in "usage".

Eric

···

On 06/04/2011 09:08 AM, Eric Firing wrote:

Eric

Yes, the behavior makes sense, the documentation doesn't; it will be fixed.

Eric

···

On 06/04/2011 09:45 AM, Phil Elson wrote:

> I think the only case where this would work correctly is if the plot
command would also trigger the creation of a new axes object.
Can't see how this can ever happen given the pyplot.plot code, which
creates a standard axes without passing through any arguments.

I agree that there are situations when it doesn't make sense to define
the projection when doing a plt.plot, maybe best to fix the projections
documentation instead of providing a keyword which is not always valid.
Either that, or plt.plot with a projection always makes a new axes?

Attempting to pass the projection currently to plot results in an exception:

    >>> plt.plot(range(10), projection='polar')
    ...
    TypeError: There is no line property "projection"

The first line of code on the page
http://matplotlib.sourceforge.net/devel/add_new_projection.html suggests
that it is possible to give the projection directly to
mpl\.pyplot\.plot but
this does not work for me\.

Should this functionality exist? I am aware that the pyplot\.plot
function is
autogenerated by boilerplate\.py, but I am a little weary of
modifying that\.

Any help gratefully received\.

Hmm, this doesn't seem 100% logically correct. I think the only case
where this would work correctly is if the plot command would also
trigger the creation of a new axes object. If the axes object already
exists, then I seriously doubt this would work as advertised. Is that
the case with your code?

Ben Root

Ben,

The first paragraph of that doc page needs repair. Trivially, there are
two references to set_xscale. The problem pointed out above is more
serious. plot() has no facility for handling a projection kwarg, and I
don't think it would make sense to try to add one. pyplot functions
that accept the projection kwarg are axes, subplot, and subplots.

Do you want to fix the paragraph, or should I?

I can take a look at it tonight.

Independently, I want to redo the FAQ discussion of draw(), show(), and
interactive versus non-interactive mode. It is possible that this topic
needs more attention elsewhere as well, but I want to start with the FAQ.

Eric

Agreed, these are some fundamental functions and probably be set apart
in a "getting started" section, maybe?

Ben Root

···

On Saturday, June 4, 2011, Eric Firing <efiring@...229...> wrote:

On 06/04/2011 06:05 AM, Benjamin Root wrote:

On Sat, Jun 4, 2011 at 9:09 AM, Phil Elson <philipelson@…476… >> <mailto:philipelson@…476…>> wrote: