plots vectors or points on the current graphics device in either two or three dimensions. The coordinates can be given in data, device, or normalized form using the DATA (the default), DEVICE, or NORMAL keywords.
The COLOR keyword can be set to a scalar or vector value. If it is set to a vector value, the line segment connecting (
) to (
) is drawn with a color index of COLOR
. In this case, COLOR must have the same number of elements as
X [, Y [, Z]]
A vector or scalar argument providing the X components of the points to be connected. If only one argument is specified,
must be an array of either two or three vectors (i.e.,
). In this special case,
are taken as the X values,
are taken as the Y values, and
are taken as the Z values.
An optional argument providing the Y coordinate(s) of the points to be connected.
An optional argument providing the Z coordinates of the points to be connected. If
is not provided, X and Y are used to draw lines in two dimensions.
has no effect if the keyword T3D is not specified and the system variable !P.T3D= 0.
Set this keyword to continue drawing a line from the last point of the most recent call to PLOTS.
PLOTS, 0, 0
PLOTS, 1, 1, /CONTINUE
PLOTS, [2,3], [2,3], /CONTINUE
Graphics Keywords Accepted
, for the description of graphics and plotting keywords not listed above.
Draw a line from (100, 200) to (600, 700), in device coordinates, using color index 12:
PLOTS, [100,600], [200,700], COLOR=12, /DEVICE
Draw a polyline where the line color is proportional to the ordinate that ends each line segment. First create datasets X and Y by entering:
X = SIN(FINDGEN(100)) & Y = COS(FINDGEN(100))
Now plot X and Y in normalized coordinates with colors as described above:
PLOTS, X, Y, COLOR = BYTSCL(Y, TOP=!D.N COLORS-1), /NORMAL
Load a good colortable to better show the result. Enter:
Draw 3D vectors over an established SURFACE plot:
SURFACE, DIST(5), /SAVE
PLOTS, [0,3], [0,3], [0,3], /T3D
PLOTS, [3,3], [0,3], [0,3], /T3D
PLOTS, [0,3], [3,3], [0,3], /T3D