errobar color

Hi I'm trying to plot some error-bars in my GUI making

    > use of the WXAgg-backend. My code looks like this: if
    > parent.error_bar:
    > a.errorbar(x.ichannel,x.intensity,x.intensity_error,ecolor='k')
    > Now, I can plot the error bars in any arbitrary color,
    > but the my actually black-on-white data are colored
    > blue upon adding error-bars this way. What I want is
    > that everything (data and their errors) is plotted
    > black. Can anybody tell how to achieve this behavior?

This is actually covered in the errorbar docstring, but subtly, so
I'll elaborate here (and update the errorbar docs with this example)

    def errorbar(self, x, y, yerr=None, xerr=None,
                 fmt='b-', ecolor=None, capsize=3,
                 barsabove=False, **kwargs):
        """
        ERRORBAR(x, y, yerr=None, xerr=None,
                 fmt='b-', ecolor=None, capsize=3, barsabove=False)

        Plot x versus y with error deltas in yerr and xerr.
        Vertical errorbars are plotted if yerr is not None
        Horizontal errorbars are plotted if xerr is not None

        ....snip.....snip....snip
===> kwargs are passed on to the plot command for the markers

So you can add additional key=value pairs to control the errorbar
markers. For example, this code makes big red squares with thick
green edges

  >>> x,y,yerr = rand(3,10)
  >>> errorbar(x, y, yerr, marker='s', mfc='red', mec='green', ms=20, mew=4)

As you may know, mfc, mec, ms and mew are aliases for the longer
property names, markerfacecolor, markeredgecolor, markersize and
markeredgewith. For more information on which properties are settable
(and their aliases), you can use the setp function

   >>> setp(Line2D)

    alpha: float
    antialiased or aa: [True | False]
    clip_box: a matplotlib.transform.Bbox instance
    clip_on: [True | False]
    color or c: any matplotlib color - see help(colors)
    dash_capstyle: ['butt' | 'round' | 'projecting']
    dash_joinstyle: ['miter' | 'round' | 'bevel']
    dashes: sequence of on/off ink in points
    data: (array xdata, array ydata)
    data_clipping: [True | False]
    figure: a matplotlib.figure.Figure instance
    label: any string
    linestyle or ls: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]
    linewidth or lw: float value in points
    lod: [True | False]
    marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' ]
    markeredgecolor or mec: any matplotlib color - see help(colors)
    markeredgewidth or mew: float value in points
    markerfacecolor or mfc: any matplotlib color - see help(colors)
    markersize or ms: float
    solid_capstyle: ['butt' | 'round' | 'projecting']
    solid_joinstyle: ['miter' | 'round' | 'bevel']
    transform: a matplotlib.transform transformation instance
    visible: [True | False]
    xclip: (xmin, xmax)
    xdata: array
    yclip: (ymin, ymax)
    ydata: array
    zorder: any number

In the API, setp is defined in matplotlib.artist and Line2D in
matplotlib.lines.

Cheers!
JDH

Thank you John. Admittedly I overlooked that one.

Cheers,
Christian

···

On 5 Jul 2005, at 17:00, John Hunter wrote:

This is actually covered in the errorbar docstring, but subtly, so
I'll elaborate here (and update the errorbar docs with this example)