![]() |
Institut für Astronomie und AstrophysikAbteilung AstronomieAchtung: ab Mitte Oktober neue Adresse und Telefon-Nummern!Attention: effective from middle of October new address and telephone numbers! |
![]() |
TVBOX
Draw a box(es) or rectangle(s) of specified width
Positions can be specified either by the cursor position or by
supplying a vector of X,Y positions.
TVBOX, width, [ x, y, color, /DATA, ANGLE= ,COLOR =, _EXTRA = ]
WIDTH - either a scalar giving the width of a box, or a 2 element
vector giving the length and width of a rectangle.
X - x position for box center, scalar or vector
Y - y position for box center, scalar or vector. If vector, then Y
must have the same number of elements as X
Positions are specified in device coordinates unless /DATA is set
If X and Y are not specified, and device has a cursor, then
TVBOX will draw a box at current cursor position
COLOR - intensity value(s) (0 - !D.N_COLORS) used to draw the box(es)
If COLORS is a scalar then all boxes are drawn with the same
color value. Otherwise, the Nth box is drawn with the
Nth value of color. Default = !P.COLOR.
None
ANGLE - numeric scalar specifying the clockwise rotation of
the boxes or rectangles.
COLOR - Scalar or vector, overrides the COLOR input parameter
/DATA - if this keyword is set and non-zero, then the box width and
X,Y position center are interpreted as being in DATA
coordinates. Note that data coordinates must be previously
defined (e.g. with a PLOT or CONTOUR call).
Any keyword recognized by PLOTS is also recognized by TVBOX.
In particular, the color, linestyle, and thickness of the boxes is
controlled by the COLOR, LINESTYLE, and THICK keywords.
A square or rectangle will be drawn on the device
For best results WIDTH should be odd when using the default DEVICE
coordinates. (If WIDTH is even, the actual size of the box will be
WIDTH + 1, so that box remains centered.)
(1) Draw a double thick box of width 13, centered at 221,256 in the
currently active window
IDL> tvbox, 13, 221, 256, thick=2
(2) Overlay a "slit" with dimension 52" x 2" on a previously displayed
image at a position angle (East of North) of 32 degrees. The
slit is to be centered at XC, YC and the plate scale
arcsec_per_pixel is known.
IDL> w = [2.,52.]/arcsec_per_pixel ;Convert slit size to pixel units
IDL> tvbox,w,XC,YC,ang=-32 ;Draw slit
(1) TVBOX does not check whether box is off the edge of the screen
(2) Allows use of only device (default) or data (if /DATA is set)
coordinates. Normalized coordinates are not allowed
ZPARCHECK
Written, W. Landsman STX Co. 10-6-87
Modified to take vector arguments. Greg Hennessy Mar 1991
Fixed centering of odd width W. Landsman Sep. 1991
Let the user specify COLOR=0, accept vector color, W. Landsman Nov. 1995
Fixed typo in _EXTRA keyword W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
Added ANGLE keyword W.Landsman February 2000
Make sure ANGLE is a scalar W. Landsman September 2001
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]