The PLOTS procedure 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 (*
X*
_{
i}
, *
Y*
_{
i}
) to (*
X*
_{
i+1}
, *
Y*
_{
i+1}
) is drawn with a color index of COLOR_{
i+1}
. In this case, COLOR must have the same number of elements as *
X*
and *
Y*
.

A vector or scalar argument providing the X components of the points to be connected. If only one argument is specified, *
X*
must be an array of either two or three vectors (i.e., ```
(2,*)
```

or ```
(3,*)
```

). In this special case, ```
X[0,*]
```

are taken as the X values, ```
X[1,*]
```

are taken as the Y values, and ```
X[2,*]
```

are taken as the Z values.

See , Graphics Keywords , for the description of graphics and plotting keywords not listed above. CLIP

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 *;
The SAVE keyword tells IDL to save the 3D transformation established by SURFACE.*

PLOTS, [0,3], [0,3], [0,3], /T3D *;
Draw a line between (0,0,0) and (3,3,3). The T3D keyword makes PLOTS use the previously established 3D transformation.*

PLOTS, [3,3], [0,3], [0,3], /T3D *;
Draw a line between (3,0,0) and (3,3,3).*

PLOTS, [0,3], [3,3], [0,3], /T3D *;
Draw a line between (0,3,0) and (3,3,3).*