![]() |
Institut für Astronomie und AstrophysikAbteilung AstronomieWaldhäuser Str. 64, D-72076 Tübingen, Germany |
![]() |
TVCIRCLE
Draw circle(s) of specified radius at specified position(s)
If a position is not specified, and device has a cursor, then a circle
is drawn at the current cursor position.
TVCIRCLE, rad, x, y, color, [ /DATA, /FILL, _EXTRA = ]
RAD - radius of circle(s) to be drawn, positive numeric scalar
X - x position for circle center, vector or scalar
Y - y position for circle center, vector or scalar
If X and Y are not specified, and the device has a cursor,
then program will draw a circle at the current cursor position
COLOR - intensity value(s) (0 - !D.N_COLORS) used to draw the circle(s)
If COLOR is a scalar then all circles are drawn with the same
color value. Otherwise, the Nth circle is drawn with the
Nth value of color. Default = !P.COLOR.
/DATA - if this keyword is set and non-zero, then the circle width and
X,Y position center are interpreted as being in DATA
coordinates. Note that data coordinates must be previously
defined (with a PLOT or CONTOUR call). TVCIRCLE will
internally convert to device coordinates before drawing the
circle, in order to maintain optimal smoothness.
/FILL - If set, fill the circle using POLYFILL
Any keyword recognized by PLOTS (or POLYFILL if /FILL is set)
is also recognized by TVCIRCLE. In particular, the color,
linestyle, and thickness of the circles are controlled by the
COLOR, LINESTYLE, and THICK keywords. If POLYFILL is set
then available keywords are LINE_FILL and FILL_PATTERN.
None
(1) TVCIRCLE does not check whether it writes off of the edge of the
display
(2) Some round-off error may occur when non-integral values are
supplied for both the radius and the center coordinates
(3) TVCIRCLE does not accept /NORMAL coordinates, only data coordinates
(if /DATA is set) or device coordinates (the default)
(4) TVCIRCLE always draws a circle --- even if /DATA is set, and the
X and Y data scales are unequal. (The X data scale is used to
define the circle radius.) If this is not the behaviour
you want, then use TVELLIPSE instead.
(1) Draw circles of radius 9 pixels at the positions specified by
X,Y vectors, using double thickness lines
IDL> tvcircle, 9, x, y, THICK = 2
Now fill in the circles using the LINE_FILL method
IDL> tvcircle, 9, x, y, /FILL, /LINE_FILL
The method used is that of Michener's, modified to take into account
the fact that IDL plots arrays faster than single points. See
"Fundamental of Interactive Computer Graphics" by Foley and Van Dam"
p. 445 for the algorithm.
Original version written by B. Pfarr STX 10-88
Major rewrite adapted from CIRCLE by Allyn Saroyan LNLL
Wayne Landsman STX Sep. 91
Added DATA keyword Wayne Landsman HSTX June 1993
Added FILL keyword. R. S. Hill, HSTX, 4-Nov-1993
Always convert to device coords, add _EXTRA keyword, allow vector
colors. Wayne Landsman, HSTX, May 1995
Allow one to set COLOR = 0, W. Landsman, HSTX, November 1995
Check if data axes reversed. P. Mangifico, W. Landsman May 1996
Converted to IDL V5.0 W. Landsman September 1997
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]