Coyote Graphics Routines

Date: Thu May 16 10:16:07 2013

single page | use frames     summary     class     fields     routine details     file attributes

.\

cgerrplot.pro


top cgErrPlot

Graphics

cgErrPlot, indep, low [, high] [, /AddCmd] [, Color=string/integer] [, /Device] [, /NoClip] [, /PSym] [, Thick=float] [, Width=float] [, _Extra=any]

The purpose of cgErrPlot is to overplot error bars for data points on previously drawn line and bar plots.

To allow cgErrPlot to be a drop-in replacement for the IDL ErrPlot program, the program can be called in either of two ways:

cgErrPlot, indep, low, high
Or:
cgErrPlot, high, low
This is a really weird syntax (high and low reversed!), so be careful!

The program requires the Coyote Library to be installed on your machine.

Parameters

indep in required type=any

The independent data vector (X vector) if all three input parameters are used. If only two input parameters are used, this parameter is assumed to be the High parameter.

low in required type=any

If three input parameters are used, this parameter is assumed to contain the low values of the error estimates. Error bars will be drawn from the low value to the high value.

high in optional type=any

If three input parameters are used, this parameter is assumed to contain the high values of the error estimates. Error bars will be drawn from the low value to the high value.

Keywords

AddCmd in optional type=boolean default=0

Set this keyword to add the command to an cgWindow display.

Color in optional type=string/integer default=black

If this keyword is a string, the name of the data color. By default, 'black'. Color names are those used with cgColor. Otherwise, the keyword is assumed to be a color index into the current color table. May be a vector of the same length as X.

Device in optional type=boolean

Not used. Just defined so it can't be used by the user of the program.

NoClip in optional type=boolean default=!P.NoClip

Defined differently than in PlotS.

PSym in optional type=boolean

Not used. Just defined so it can't be used by the user of the program.

Thick in optional type=float default=!P.Thick

The width of the lines used to draw the error bars.

Width in optional type=float

The width of the error bars, in units of the width of the plot area. The default is 1% of plot width. May be a vector of the same length as X.

_Extra in optional type=any

Any graphics keywords supported by the PLOTS command are allowed.

Examples

Use like the IDL ErrPlot command:

data = cgDemoData(1) seed = 3L ; So you see what I see. x = Indgen(N_Elements(data)) cgPlot, x, data errLow = RandomU(seed, N_Elements(data)) * 1.5 errHigh = RandomU(seed, N_Elements(data)) * 1.5
Then, use this:
cgErrPlot, x, data-errLow, data+errHigh, COLOR='red'
Or, use this:
cgErrPlot, data+errHigh, data-errLow, Color='red'
Use with a bar plot:
bardata = Indgen(10)+1 barLow = RandomU(seed, N_Elements(bardata)) * 1.5 barHigh = RandomU(seed, N_Elements(bardata)) * 1.5 cgBarPlot, bardata, BarCoords=x cgErrPlot, x, bardata-barLow, bardata+barHigh, Color='blue'

Author information

Author:

FANNING SOFTWARE CONSULTING:

David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com

Copyright:

Copyright (c) 2012, Fanning Software Consulting, Inc.

History:

Change History:

Written, 30 Jan 2012. Modeled on ErrPlot from IDL library. David W. Fanning.

File attributes

Modification date: Fri Feb 15 07:40:34 2013
Lines: 220
Docformat: rst rst