Chapter 8: Elementary Plot Routines This chapter describes elementary subroutines that plot lines, vectors, circles, ellipses, pie segments and poly- gons. There are versions for plot and user coordinates; the routines for user coordinates begin with the keyword 'RL'. These routines can only be called from level 2 or 3 after an axis system has been defined. 8.1 Lines XMOVE and XDRAW are simple subroutines for plotting lines. They require absolute page coordinates and are, therefore, not affected by a call to ORIGIN. Different line styles can- not be used. The routine XMOVE moves the pen to a point while XDRAW draws a line to a point. The calls are: CALL XMOVE (X, Y) level 1, 2, 3 CALL XDRAW (X, Y) level 1, 2, 3 X, Y are absolute page coordinates. The subroutines STRTPT and CONNPT require plot coordinates as real numbers and allow different line styles to be used. The calls are: CALL STRTPT (X, Y) level 1, 2, 3 CALL CONNPT (X, Y) level 1, 2, 3 X, Y are real numbers containing the plot coordi- nates. The corresponding routines for user coordinates are: The calls are: CALL RLSTRT (X, Y) level 2, 3 CALL RLCONN (X, Y) level 2, 3 Note: Lines plotted with RLSTRT and RLCONN will not be cut off at the borders of an axis system. This can be enabled with the routine CLPBOR. Points lying outside of the axis scaling will not be listed by RLSTRT and RLCONN. L I N E LINE joins two points with a line. Different line styles can be used. The call is: CALL LINE (NX, NY, NU, NV) level 1, 2, 3 NX, NY are the plot coordinates of the first point. NU, NV are the plot coordinates of the second point. R L I N E RLINE is the corresponding routine for user coordinates. The call is: CALL RLINE (X, Y, U, V) level 2, 3 X, Y are the user coordinates of the first point. U, V are the user coordinates of the second point. Note: RLINE draws only that part of the line lying inside the axis system. If NOCHEK is not used, points lying outside the axis scaling will be listed. 8.2 Vectors V E C T O R VECTOR plots vectors with none, one or two arrow heads. The call is: CALL VECTOR (IX1, IY1, IX2, IY2, IVEC) level 1, 2, 3 IX1, IY1 are the plot coordinates of the start point. IX2, IY2 are the plot coordinates of the end point. IVEC is a four digit number 'wxyz' specifying the arrow heads where the digits have the follow- ing meaning: (see appendix B for examples) w: determines the ratio of width and length (0 - 9). x: determines the size (0 - 9). y: determines the form: = 0 filled = 1 not filled = 2 opened = 3 closed. z: determines the position: = 0 no arrow heads are plotted = 1 at end points = 2 at start and end points = 3 at start and end points and in the same direc- tion. R L V E C RLVEC is the corresponding routine for user coordinates. The call is: CALL RLVEC (X1, Y1, X2, Y2, IVEC) level 2, 3 8.3 Geometric Figures The following subroutines plot geometric figures such as rectangles, circles, ellipses, pie segments and polygons. These routines can be used to plot only the outlines of figures or the figures can be filled in with shaded pat- terns. R E C T A N RECTAN plots rectangles. The call is: CALL RECTAN (NX, NY, NW, NH) level 1, 2, 3 NX, NY are the plot coordinates of the upper left corner. NW, NH are the width and height in plot coordinates. R N D R E C RECTAN plots an rectangle where the corners will be rounded. The call is: CALL RNDREC (NX, NY, NW, NH, IOPT) level 1, 2, 3 NX, NY are the plot coordinates of the upper left corner. NW, NH are the width and height in plot coordinates. IOPT defines the rounding of corners (0 <= IOPT <= 9). For IOPT = 0, rounding is disabled. C I R C L E CIRCLE plots circles. The call is: CALL CIRCLE (NX, NY, NR) level 1, 2, 3 NX, NY are the plot coordinates of the centre point. NR is the radius in plot coordinates. E L L I P S ELLIPS plots ellipses. The call is: CALL ELLIPS (NX, NY, NA, NB) level 1, 2, 3 NX, NY are the plot coordinates of the centre point. NA, NB are the radii in plot coordinates. P I E PIE plots pie segments. The call is: CALL PIE (NX, NY, NR, ALPHA, BETA) level 1, 2, 3 NX, NY are the plot coordinates of the centre point. NR is the radius in plot coordinates. ALPHA, BETA are the start and end angles measured in de- grees in a counter-clockwise direction. A R C E L L ARCELL plots elliptical arcs where the arcs can be rotated. The call is: CALL ARCELL (NX, NY, NA, NB, ALPHA, BETA, T) level 1, 2, 3 NX, NY are the plot coordinates of the centre point. NA, NB are the radii in plot coordinates. ALPHA, BETA are the start and end angles measured in de- grees in a counter-clockwise direction. T is the rotation angle measured in degrees in a counter-clockwise direction. A R E A F AREAF draws polygons. The call is: CALL AREAF (NXRAY, NYRAY, N) level 1, 2, 3 NXRAY, NYRAY are arrays containing the plot coordinates of the corner points. Start and end points can be different. N is the number of points. The corresponding routines for user coordinates are: The calls are: CALL RLREC (X, Y, WIDTH, HEIGHT) lev. 2, 3 CALL RLRND (X, Y, WIDTH, HEIGHT, IOPT) CALL RLCIRC (XM, YM, R) CALL RLELL (XM, YM, A, B) CALL RLPIE (XM, YM, R, ALPHA, BETA) CALL RLARC (XM, YM, A, B, ALPHA, BETA, T) CALL RLAREA (XRAY, YRAY, N) Notes: - Shading patterns can be defined with SHDPAT and MYPAT. If the pattern number is zero, the figures will only be outlined. With CALL NO- ARLN, the outline will be suppressed. - The number of points in AREAF and RLAREA is limited to 2000. - For the calculation of the radius in RLCIRC and RLPIE, the X-axis scaling is used. - The interpolation of circles and ellipses can be altered with CIRCSP (NSPC) where NSPC is the arc length in plot coordinates. The de- fault value is 10.