CGPLOTS
The purpose of cgPlotS is to create a wrapper for the traditional IDL graphics
command, PlotS. The primary purpose of this is to create plot commands that work
and look identically both on the display and in PostScript files.
Categories
Graphics
Params
X: in, required, type=any
A vector or scalar argument providing the X components of the points to be
drawn or connected. May be a 2xN or 3xN array, if Y and Z parameters are
not used.
Y: in, optional, type=any
A vector or scalar argument providing the Y components of the points to be
drawn or connected.
Z: in, optional, type=any
A vector or scalar argument providing the Z components of the points to be
drawn or connected.
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='opposite'
If this keyword is a string, the name of the data color.
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.
map_object: in, optional, type=object
If you are drawing on a map projection set up with Map_Proj_Init
and using projected meter space, rather than lat/lon space, then you can use this
keyword to provide a cgMap object that will allow you to convert the `x` and `y`
parameters from longitude and latitude, respectively, to projected meter space
before drawing. X and Y must both be present.
psym: in, optional, type=integer
Any normal IDL PSYM values, plus any value supported by the Coyote Library
routine cgSYMCAT. An integer between 0 and 46. May also be specified as a
symbol names. See cgSymCat for details.
symcolor: in, optional, type=string/integer/vector, default=COLOR
If this keyword is a string, the name of the symbol color. By default, same as COLOR.
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.
symsize: in, optional, type=float/vector, default=1.0
A scalar or vector of symbol sizes. Default is 1.0. May be a vector of the same
length as X.
window: in, optional, type=boolean, default=0
Set this keyword to add the command to the current cgWindow application.
_extra: in, optional, type=any
Any keywords supported by the PLOTS command are allowed.
Examples
Use like the IDL PLOTS command::
IDL> cgPlot, Findgen(11)
IDL> cgPlotS, !X.CRange, [5,5], LINESTYLE=2, THICK=2, COLOR='red'
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
History
Change History::
Written, 12 November 2010. DWF.
Added SYMCOLOR keyword. PSYM accepts all values from cgSYMCAT. SYMCOLOR and SYMSIZE
keywords can be vectors the size of x. 15 November 2010. DWF
Added ability to support COLOR keyword as a vector the size of x. 15 November 2010. DWF
Now setting decomposition state by calling SetDecomposedState. 16 November 2010. DWF.
Final color table restoration skipped in Z-graphics buffer. 17 November 2010. DWF.
Changes so that color variables don't change type. 23 Nov 2010. DWF.
Modified to use decomposed color, if possible. 24 Dec 2010. DWF.
Whoops! Programming is like herding cats! 29 Dec 2010. DWF.
In some cases, I was turning BYTE values to strings without converting to
INTEGERS first. 30 Dec 2010. DWF.
Moved setting to decomposed color before color selection process to avoid PostScript
background problems when passed 24-bit color integers. 12 Jan 2011. DWF.
Added WINDOW keyword. 24 Jan 2011. DWF.
Made a modification that allows THICK and COLOR keywords apply to symbols, too. 24 Feb 2011. DWF.
Modified error handler to restore the entry decomposition state if there is an error. 17 March 2011. DWF
Fixed a problem in which the colors of the line was not accurate in some cases. 29 November 2011. DWF.
Added the MAP_OBJECT keyword for plotting on map projections. 2 Jan 2012. DWF.
Made sure the map coordinate system is established before drawing if a map object is passed
into the program. 26 June 2012. DWF.
Added the ability to specify the PSYM keyword as a string. 20 July 2012. DWF.
Copyright
Copyright (c) 2010-2012, Fanning Software Consulting, Inc.