Feature request: passing line properties through psd, csd, stem, etc.

In pylab plot() there are named parameters that can be included to control line properties such as label, linestyle, etc. But in psd(), stem(), box() and other specialized plotting commands these parameters usually do not work. It would be useful to have them use the same options when it makes sense.

Can these options be added to psd() and other plot commands to pass through these same options to plot() or whatever is used for the final display? Since these commands do not return the lines like plot() does it is a little harder to control the properties.

For now what is the best way to change line properties and add labels when using stem() or psd()?

Also, unrelated but is there a property I can check once using matplotlib to get the version information (something like matplotlib.version)?

– David

Dave wrote:

Also, unrelated but is there a property I can check once using matplotlib to
get the version information (something like matplotlib.version)?

matplotlib.__version__

this has become something of a python standard.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Thanks Chris! I’m using ipython – why suffer with anything else;-) – and I use tab completion to see namespace properties. I have it set to filter out double-underscore names on the assumption that these are intended to be private by convention. It seems to me that version should not be double-underscored unless I misunderstand the convention. Anyway it works and I will certainly remember it now. As soon as i type matplotlib.__v(tab) it shows up. My version is 0.81 for those who can’t handle suspense.

Originally my question was about how to handle line properties when using psd and other higher-level plotting routines. I figured out how to set them manually by keeping a reference to the axis before plotting and then manually adjusting things one item at a time. It’s wordy but works fine. I see now there is a setp() function that should help with this but I still have to get the lines from the axes object first. Directly setting these properties in psd would be much cleaner in common use cases I think.

I looked in to how to improve this for psd and csd at least. It turns out to be trivial to add. I just added ‘**kwargs’ to the parameter lists of psd def and to it’s call to plot(). this is in file axes.py. This way the extra keywords just get passed along. I don’t know how to submit a patch but could this be added to psd and csd functions? I also don’t know if there would be any side effects so it might need to be checked a bit more carefuly.

– Dave

···

On 1/4/06, Christopher Barker <Chris.Barker@…259…> wrote:

Dave wrote:

Also, unrelated but is there a property I can check once using matplotlib to
get the version information (something like matplotlib.version)?

matplotlib.version

this has become something of a python standard.

Dave wrote:

Thanks Chris! I'm using ipython -- why suffer with anything
else;-) -- and I use tab completion to see namespace properties. I
have it set to filter out double-underscore names on the assumption
that these are intended to be private by convention. It seems to me
that __version__ should not be double-underscored unless I
misunderstand the convention.

AFAIU, in python, a leading *single* underscore means "private". Double
underscore is generally used for "special" symbols. These may be symbols
that have a special meaning for the python interpreter itself or are
just special by convention. (Documentation, meta-information etc.)