The Translate method moves or translates a graphic item in the X, Y, or Z dimensions.
Example
x = FINDGEN(100)
y = 20 * Sin(x*2*!PI/25.0) * Exp(-0.01*x)
p = PLOT(x, y, XRANGE=[0,99], YRANGE=[-40,100], $
FILL_LEVEL=-40, $
AXIS_STYLE=0, MARGIN=0, DIMENSIONS=[500,400], $
BACKGROUND_COLOR="light sky blue", $
/FILL_BACKGROUND, FILL_COLOR="sea green", TRANSPARENCY=100)
e = ELLIPSE(0.9, 1, FILL_COLOR="yellow", COLOR="yellow")
xx = 0.5*[-22,-19,-12,-7,8,13,18,23,0.5,0.5, $
13,8,0.5,0.5,8,3,-2,-7,0,0,-7,-12,0,0]
yy = 2*[3,-0.7,-1,-1.5,-1.5,-0.7,0.5,3,3,5, $
5,13,13,15,15,20,20,15,15,13,13,5,5,3]
p1 = POLYGON(xx,yy,1,/DATA,FILL_COLOR="burlywood", CLIP=0)
FOR i=1,99 DO BEGIN & $
p.SAVE, 'translatemethod_ex.gif', RES=96, /APPEND & $
p1.TRANSLATE, 1, y[i]-y[i-1], /DATA & $
e.TRANSLATE, 1,-0.5 & $
ENDFOR
p.SAVE, 'translatemethod_ex.gif', RES=96, /APPEND, /CLOSE
Syntax
graphic.Translate, X, Y, Z [, /DATA] [, /DEVICE] [, /NORMAL] [, /RESET]
Arguments
X, Y, Z
The translation along the X, Y, and Z dimensions. A value of 0 indicates no translation. If Z is not supplied then the default is 0.
Keywords
DATA
Set this keyword if the input arguments are specified in data coordinates.
DEVICE
Set this keyword if the input arguments are specified in device coordinates (pixels). This is the default behavior.
NORMAL
Set this keyword if the input arguments are specified in normalized [0, 1] coordinates.
RESET
Set this keyword to 1 to reset the translation to 0 before performing any translation. If RESET is specified then X, Y, and Z are optional.
Version History
See Also
Rotate Method,
Scale Method