This section will present the conventions used by the plotting subroutines in the PSPLOT plotting library. This information can be used to create customized plotting subroutines.
A plotting session is a set of plotting instructions in a user's application program which produces hardcopy graphic display output. The output can be either a single plot or graph or a set of graphs. Every plotting session must begin with a call to subroutine PSINIT (with the exception of a call to NEWDEV) and end with a call to subroutine PLOTND.
Pen movement is occasionally mentioned throughout this manual. While PostScript does not use an actual pen for graphic production, it is useful to visualize the plot commands as directing the movements of a pen of variable thickness to a specified (x,y) coordinate, with the pen being either up or down. The plotting subroutines are simple, user-callable commands which direct the movements of an imagined pen upon a plotting sheet.
The initial coordinate origin is approximately .5 inches from the bottom and left paper edges. The orientation of the page must be specified to be either portrait (short side horizontal) or landscape (long side horizontal) and is set by the call to PSINIT (which see). The figure below shows the paper orientation and beginning plot origin for portrait and landscape modes. The current plot origin can be relocated to other positions during the plotting session to provide new reference points for subsequent plotting commands. When the next graph is started, the new origin should be placed far enough away to avoid overlapping the just-completed graph.
All plotting commands use an absolute plot coordinate system. This means that all coordinates passed to plotting subroutines are expected to be in terms of distance from the current plot origin. This is contrast to a relative plot coordinate system, in which coordinates are assumed to be in terms of distance from the current pen position.
In all plotting subroutines, plot coordinates, character heights, distances, etc. can be in arbitrary units. The default is inches. This can be changed by the variable conver in subroutine PSINIT.
Unless otherwise noted, any subroutine argument which specifies an angle is stated in degrees relative to the X axis, with positive angles measured counterclockwise from the X axis.
Most character variables are specified as Hollerith, rather than character strings. The reason for this is primarily historical, combined with the fact that the enormous amount of code already written and in use at my site precluded a comprehensive revision. This should not cause any problems, however.
The initial font of a plot session is Helvetica, with a size of 12 points. This can be changed permanently in subroutine PSINIT. Of course, the current font can always be changed with subroutine SETFNT. PSPLOT supports the standard 35 fonts found on most PostScript printers.
PSPLOT supports color, although all examples in this manual are shown in grayscale for the purposes of reproduction. Color is specified in the relevant subroutines as red, green, and blue (RGB) values.
Continuation allows you to append a character string or number to the end of a previously plotted string or number. The coordinates of the appended string are automatically calculated. Whether or not a subroutine supports continuation is stated in subroutine description in the next section.
Continuation is specified by setting the X and/or Y coordinate argument in calls to the subroutines listed above to 999, and may be applied to X and Y coordinates separately. A subroutine call with continuation must immediately follow the previous plotting call. Continuation is useful when plotting strings containing variable values, such that the resultant string length is not known beforehand.
CALL KEKNUM (1., 2., .15, FLOAT(ND), 0., -1, 0)
CALL KEKSYM (999., 999., .15, 5H DAYS, 0. ,5, 0)
produces "10 DAYS".