Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

PLOTS


Syntax | Arguments | Keywords | Examples | Version History | See Also

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 (Xi, Yi) to (Xi+1, Yi+1) is drawn with a color index of COLORi+1. In this case, COLOR must have the same number of elements as X and Y.

Syntax

PLOTS, X [, Y [, Z]] [, /CONTINUE]

Graphics Keywords: [, CLIP=[X0, Y0, X1, Y1]] [, COLOR=value] [, /DATA | , /DEVICE | , /NORMAL] [, LINESTYLE={0 | 1 | 2 | 3 | 4 | 5}] [, /NOCLIP] [, PSYM=integer{0 to 10}] [, SYMSIZE=value] [, /T3D] [, THICK=value] [, Z=value]

Arguments

X

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.

Y

An optional argument providing the Y coordinate(s) of the points to be connected.

Z

An optional argument providing the Z coordinates of the points to be connected. If Z is not provided, X and Y are used to draw lines in two dimensions.

Z has no effect if the keyword T3D is not specified and the system variable !P.T3D= 0.

Keywords

CONTINUE

Set this keyword to continue drawing a line from the last point of the most recent call to PLOTS.

For example:

; Position at (0,0): 
PLOTS, 0, 0 
 
; Draws vector from (0,0) to (1,1): 
PLOTS, 1, 1, /CONTINUE 
 
; Draws two vectors from (1,1) to (2,2) to (3,3): 
PLOTS, [2,3], [2,3], /CONTINUE 

Graphics Keywords Accepted

See Graphics Keywords, for the description of graphics and plotting keywords not listed above. CLIP, COLOR, DATA, DEVICE, LINESTYLE, NOCLIP, NORMAL, PSYM, SYMSIZE, T3D, THICK, Z.

Examples

; 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: 
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: 
LOADCT, 13 
 
; Draw 3-D vectors over an established SURFACE plot. 
; The SAVE keyword tells IDL to save the 3-D transformation  
; established by SURFACE. 
SURFACE, DIST(5), /SAVE 
 
; Draw a line between (0,0,0) and (3,3,3). The T3D keyword makes  
; PLOTS use the previously established 3-D transformation: 
PLOTS, [0,3], [0,3], [0,3], /T3D 
 
; Draw a line between (3,0,0) and (3,3,3): 
PLOTS, [3,3], [0,3], [0,3], /T3D 
 
; Draw a line between (0,3,0) and (3,3,3): 
PLOTS, [0,3], [3,3], [0,3], /T3D 

Version History

Introduced: Original

See Also

ANNOTATE, IPLOT, XYOUTS


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]