Reads a polygon interactively from the current graphics device (M.A. Mugglestone, S.A. Harding, B.Y.Y. Lee, P.J. Diggle & B.S. Rowlingson).
Options
PRINT = string token |
What to print (summary); default summ |
|---|---|
WINDOW = scalar |
Window from which to read default 1 |
Parameters
YPOLYGON = variates |
Variates to receive the vertical coordinates of the polygons that are read |
|---|---|
XPOLYGON = variates |
Variates to receive the horizontal coordinates of the polygons that are read |
PEN = scalars |
Pen numbers to use to echo points |
Description
DRPOLYGON uses the DREAD directive to read the coordinates of a sequence of points which define a polygon. The WINDOW option may be used to specify the window from which to read. The DREAD directive will only work within a window that contains a graph or a contour plot. A call to DRPOLYGON should, therefore, be preceded by a call to DPTMAP, DPOLYGON, DGRAPH or DCONTOUR.
DREAD is not always available, and its operation may vary slightly from one system to another. The Users’ Note supplied with Genstat explains how to read points and terminate input on specific devices. The usual method for reading points is to click the left mouse button at the required position. The usual way to terminate input is to click the right mouse button. The last point of any polygon is implicitly connected to the first point. There is no need to re-enter the first point to draw a closed polygon – this will be done automatically after input has been terminated. The horizontal and vertical coordinates of the polygon may be saved using the parameters XPOLYGON and YPOLYGON, respectively.
The PEN parameter may be used to specify which pen to use to echo points which have been read. The default setting of PEN uses METHOD=line, LINESTYLE=1, SYMBOLS=1 and JOIN=given.
Printed output is controlled by the PRINT option. The default setting of summary prints the horizontal and vertical coordinates of the polygon under the headings XPOLYGON and YPOLYGON.
Options: PRINT, WINDOW.
Parameters: YPOLYGON, XPOLYGON, PEN.
Method
If the PEN parameter is unset then a pen with METHOD=line, LINESTYLE=1, SYMBOLS=1 and JOIN=given will be specified using the PEN directive. The DREAD directive is used to read in the coordinates of an open polygon, and then the DGRAPH directive is used to draw a line joining the last point of the polygon to the first point.
See also
Commands for: Graphics, Spatial statistics.
Example
CAPTION 'DRPOLYGON example'; STYLE=meta CALCULATE x,y = URAND(314632,0; 50) DPTMAP [ENDACTION=continue] Y=y; X=x; PEN=2 DRPOLYGON