POSTSCRIPT FOR TECHNICAL DRAWINGS PSPLOT: A FORTRAN-CALLABLE POSTSCRIPT PLOTTING LIBRARY USER'S MANUAL Kevin E. Kohler Nova Southeastern University Oceanographic Center 8000 North Ocean Drive Dania, Florida 33004 N O V A S O U T H E A S T E R N U N I V E R S I T Y OCEANOGRAPHIC CENTER
91
Embed
POSTSCRIPT FOR TECHNICAL DRAWINGS PSPLOT: A FORTRAN ... · POSTSCRIPT FOR TECHNICAL DRAWINGS PSPLOT: A FORTRAN-CALLABLE POSTSCRIPT PLOTTING LIBRARY USER'S MANUAL Kevin …
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
POSTSCRIPT FOR TECHNICAL DRAWINGSPSPLOT: A FORTRAN-CALLABLEPOSTSCRIPT PLOTTING LIBRARY
USER'S MANUAL
Kevin E. Kohler
Nova Southeastern UniversityOceanographic Center
8000 North Ocean DriveDania, Florida 33004
N O
V A
S O U T H E A S T E
R N
U N I V E R S I T
Y
OCEANOGRAPHICCENTER
1. INTRODUCTION
This manual is intended for users interested in generating two-dimensionaltechnical drawings or graphics for technical journals in PostScript format. The manualdescribes a library of Fortran-callable subroutines which can be combined in a callingprogram to produce PostScript plot files. The purpose, syntax, and calling conventionof each subroutine is presented , along with plotting examples.
PostScript is a very robust graphics and typesetting language with wide-rangingcapabilities. Since the focus of the subroutines in this library is to produce technicaldrawings, many of the "artistic" features of PostScript have not been addressed orincluded here.
The name PostScript is a registered trademark of Adobe Systems Incorporated.All instances of the name PostScript in this manual are references to the PostScriptlanguage as defined by Adobe Systems Incorporated.
This section will present the conventions used by the plotting subroutines in thePSPLOT plotting library . This information can be used to create customized plottingsubroutines.
A plotting session is a set of plotting instructions in a user's application programwhich produces hardcopy graphic display output. The output can be either a singleplot or graph or a set of graphs. Every plotting session must begin with a call tosubroutine PSINIT (with the exception of a call to NEWDEV) and end with a call tosubroutine PLOTND.
Pen movement is occasionally mentioned throughout this manual. WhilePostScript does not use an actual pen for graphic production, it is useful to visualize theplot 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 aresimple, user-callable commands which direct the movements of an imagined pen upona plotting sheet.
The initial coordinate origin is approximately .5 inches from the bottom and leftpaper edges. The orientation of the page must be specified to be either portrait (shortside 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 originfor portrait and landscape modes. The current plot origin can be relocated to otherpositions during the plotting session to provide new reference points for subsequentplotting commands. When the next graph is started, the new origin should be placedfar enough away to avoid overlapping the just-completed graph.
Plotting Sheet Orientation
Portrait
(0., 0.)
Landscape
(0., 0.)
All plotting commands use an absolute plot coordinate system. This means thatall coordinates passed to plotting subroutines are expected to be in terms of distancefrom the current plot origin. This is contrast to a relative plot coordinate system, inwhich coordinates are assumed to be in terms of distance from the current pen position.
In all plotting subroutines, plot coordinates, character heights, distances, etc. aremeasured in inches.
Unless otherwise noted, any subroutine argument which specifies an angle isstated in degrees relative to the X axis, with positive angles measured counterclockwise from theX 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 enormousamount of code already written and in use at my site precluded a comprehensiverevision. This should not cause any problems, however.
The initial font of a plot session is Helvetica, with a size of 12 points. This can bechanged permanently in subroutine PSINIT. Of course, the current font can always bechanged with subroutine SETFNT. PSPLOT supports the standard 35 fonts found onmost PostScript printers.
PSPLOT supports color, although all examples in this manual are shown ingrayscale for the purposes of reproduction. Color is specified in the relevantsubroutines as red, green, and blue (RGB) values.
Continuation allows you to append a character string or number to the end of apreviously plotted string or number. The coordinates of the appended string areautomatically calculated. Whether or not a subroutine supports continuation is statedin subroutine description in the next section.
Continuation is specified by setting the X and/or Y coordinate argument in callsto the subroutines listed above to 999, and may be applied to X and Y coordinatesseparately. A subroutine call with continuation must immediately follow the previousplotting call. Continuation is useful when plotting strings containing variable values,such that the resultant string length is not known beforehand.
This section describes the subroutines in the PSPLOT plotting library at the timeof this writing. These routines are Fortran-callable from an application program. Belowis a brief summary of the subroutines, followed by an alphabetical listing of eachsubroutine containing a more detailed description of its function, syntax, and callingarguments.
ARC Draws an arc of a specified radius and center.
AROHED Draws an arrowhead at a specified location.
ARROW Draws an arrow including the shaft.
AXIS Draws an axis of a graph, with user-specified axis titles.
BLKSTP Strips out embedded blanks in a character string.
BORDER Draws a rectangular border with tick marks.
CHOPIT Logically closes the current page and begins a new one.
CIRCLE Draws a circle with specified center, radius and fill.
CLIP Inserts the PostScript command clip into the output file.
CLIPBOX Defines the current clipping area.
COLBOX Fills regions with specified color.
CONCOLR Draws colored contour plots of a 2-dimensional array ofregularly-spaced data.
CONFILL Draws grayscale contour plots of a 2-dimensional array ofregularly-spaced data.
CONREC Draws contour plots of a 2-dimensional array of regularly-spaced data.
CURVE Draws a curve between 2 points with specified beginning andending slopes.
DRWCRV Connects data points with a solid line.
DRWTRI Draws a triangle.
DSHCRV Connects data points with a dashed curve.
DSHLIN Draws a dashed line between two points.
FACTOR Enlarges or reduces a plot by a specified ratio.
FAROHED Draws a "fancy" arrowhead.
FILLBOX Fills a shape with a specified grayscale level.
FILRGN Same as FILLBOX, except it restores the current gray level afterfilling.
FILRGNC Fills a shape with the current gray level or color.
GREST Calls the PostScript operator grestore.
GRKSYM Plots a Greek symbol.
GSAV Calls the PostScript operator gsave.
HILITEC Prints text surrounded by a rectangular box (color).
HILITEG Prints text surrounded by a rectangular box (grayscale).
INTEGRAL Plots an integral with upper and lower limits.
KEKEXP Plots a floating point number in exponential format.
KEKFLT Plots a floating point number in floating point format.
KEKNUM Plots a floating point number.
KEKSYM Plots a character string.
KEKSYMC Plots a character string, with the text string being chararacterrather than Hollerith.
KEKSYMO Plots a character string with the characters outlined instead offilled.
LENSTR Computes the number of characters in a character string.
NEWDEV Specifies the name of the output PostScript file.
NUMBER Plots a floating point number. Similar to KEKNUM, butjustification and continuation are not supported.
ONEHLF Draws the symbol ½.
OVERBAR Draws a character string with an overbar.
OVRSBSP Draws an overbar over a subscripted and superscriptedcharacter string.
OVRSBSPG Draws an overbar over a subscripted and superscripted Greeksymbol.
OVERSUB Draws an overbar over a subscripted character string.
OVERSUBG Draws an overbar over a subscripted Greek symbol.
OVERSUP Draws an overbar over a superscripted character string.
OVERSUPG Draws an overbar over a superscripted Greek symbol.
OVRGRK Draws an overbar over a Greek symbol.
PLOT Directs "pen" movement to a specified (x,y) point with the"pen" either up or down.
PLOTND Closes the output PostScript file and terminates the plottingsession.
PLSMIN Draws the ± character.
PRIME Draws the ' character.
PSINIT Called to begin a plotting session. It also specifies portrait orlandscape mode.
RECT Draws a rectangle.
RECTFILC Draws a rectangle and fills it with specified red, green, andblue color levels.
RECTFILG Draws a rectangle and fills it with specified gray level.
ROTATE Rotates the current coordinate system by a specified angle.Essentially, ROTATE issues the PostScript rotate command.
RRECT Draws a rectangle with rounded corners. It can then fill therectangle with the current graylevel or RGB values.
SETCOLR Sets the current color values.
SETFNT Sets the current font.
SETGRY Sets the current gray level value.
SETLW Sets the current line width.
SIGMA Draws the symbol Σ, with upper and lower limits.
SLDCRV Connects data points with a solid curve.
SLDLIN Draws a solid line between two points.
SQRSGN Draws the radical (square root) sign.
SQUARE Draws a square.
STROKE Calls the PostScript operator stroke.
SUBBER Draws a subscript.
SUBBERSP Draws a subscript of “special” characters.
SUBSUP Draws a subscript and superscript.
SUBSUPSP Draws subscripts and superscripts of “special” characters.
SUPER Draws a superscript.
SUPERSP Draws a superscript of “special” characters.
SYMBOL Plots a character string. Similar to KEKSYM, but justificationand continuation are not supported.
The plotting subroutines in the PSPLOT plotting library are written in Fortranand are called by user-written application programs. In the following subroutinedescriptions, integer variables are denoted by arguments beginning with the letters I-N,as per Fortran convention. All other variables are real (4 byte) floating point Fortranand are called by user-written application programs. All of the subroutines are writtenin single precision. Hence, if your program generates data in double precision, anyarguments sent to the plotting library subroutines must first be converted to singleprecision.
ARC
PURPOSE ARC draws an arc having a specified radius and arc center.
XPP,YPP X,Y coordinates of the tip of the arrowhead.
DIR Direction of arrowhead, measured east from north.
AROLNP Length of arrowhead sides.
SPRANG Half the angular spread of arrowhead.
LOCXY Location of arrowhead pointLOCXY=1 XPP,YPP at arrowhead point (most commonly used)LOCXY=2 XPP, YPP at center of arrowhead.LOCXY=3 XPP,YPP at tail of arrowhead.
XSS,YSS X,Y coordinates of the vector length origin.
XPP,YPP X,Y coordinates of the tip of the arrowhead.
AROLNP Length of arrowhead sides.
SPRANG Half the angular spread of arrowhead.
LOCXY Location of arrowhead pointLOCXY=1 XPP,YPP at arrowhead point (most commonly used)LOCXY=2 XPP, YPP at center of arrowhead.LOCXY=3 XPP,YPP at tail of arrowhead.
NC Number of characters in title. Its sign is used to specify on which sideof the axis the title is to appear: positive for the counterclockwise sideof the axis, negative for the clockwise side. Positive labeling is gener-ally used for Y axes, negative for X axes.
AXLEN Length of axis.
THETA Angle of axis. Generally, 0 for X axes, 90 for Y axes.
RMIN The starting value and annotation of the first tick mark.
ITIC Four digit number which determines which of the border sides willcontain tick marks. Each of the digits is either 0 or 1, and if set to 1,that side will contain tick marks. The border sides are ordered asfollows:
Left-vertical Bottom Right-vertical Top
For example, if ITIC = 1011, all sides except the bottom would containtick marks. Additionally, if ITIC<0, the tick marks will be drawn onthe outside of the border than on the inside (default).
IBRD IBRD is similar to ITIC except that it determines which sides of theborder will be drawn. Hence, you can have tick marks with no bor-der, and vice versa.
MAJX Number of major divisions in the x-direction. A longer tick mark isdrawn for these divisions.
MINX Number of minor divisions in the x-direction, i.e. the number of divi-sions per major division. A shorter tick mark is drawn for these divi-sions.
PURPOSE CHOPIT logically closes the current graphics page and begins a new one.
SYNTAX CALL CHOPIT (XPP, YPP)
ARGUMENTS
XPP,YPP X,Y coordinates of the initial plot origin of the next plot. This allowsyou to begin all plots at the same origin on each page.
Note: XPP and YPP are coordinates independent of the current scaling factor.That is, XPP and YPP represent actual inches, not scaled coordinates. The currentscaling factor is reinstated after the new coordinate origin is set.
Subroutine CHOPIT should not be confused with subroutine PLOTND, which iscalled once at the end of each plotting session and which closes the entire outputPostScript file.
CIRCLE
PURPOSE CIRCLE draws a circle.
SYNTAX CALL CIRCLE (XC, YC, RAD, FILL)
ARGUMENTS
XC,YC X,Y coordinates of the center of the circle.
RAD Radius of the circle.
FILL Logical value. If FILL=.TRUE., circle is filled with the current color orgray scale; otherwise it is outlined.
ARR Two-dimensional array containing regularly spaced data to becontoured. CONCOLR assumes ARR(1,1) is located at the lower leftcorner of the plot. Data points ARR(1,1) through ARR(IEXT,JEXT)are contoured in an area XLEN x YLEN.
IMAX The first dimension of ARR in the calling program.
IEXT Number of points in x-direction of ARR to be contoured.
JEXT Number of points in y-direction of ARR to be contoured.
XLEN X-direction length of plotting area.
YLEN Y-direction length of plotting area.
CVAL Array containing the values to be used for contour intervals (1 toNVAL). CVAL must be dimensioned with a dimension of at least 1.Unlike in subroutine CONREC, NVAL cannot equal 0.
COLOR Array dimensioned (3,NVAL) containing the red, green, and bluevalues for each of the contour levels. The red value is stored in (1,n),the green value in (2,n) and the blue value in (3,n), where n specifiesthe contour index corresponding to CVAL. Regions less than or equalto the corresponding contour value CVAL are filled with the corre-sponding RBG values.
NVAL Number of contour intervals. NVAL must be less than or equal to100, and unlike in CONREC, NVAL cannot equal 0.
IOFFP Flag indicating that grid boxes whose vertices have the value SPVALare to be ignored during contouring.
SPVAL Special value denoting which grid boxes are to be ignored duringcontouring.
See coding example for CONFILL.
CONFILL
PURPOSE CONFILL draws grayscale contour plots of a two-dimensional array ofregularly spaced data.
ARR Two-dimensional array containing regularly spaced data to becontoured. CONFILL assumes ARR(1,1) is located at the lower leftcorner of the plot. Data points ARR(1,1) through ARR(IEXT,JEXT)are contoured in an area XLEN x YLEN.
IMAX The first dimension of ARR in the calling program.
IEXT Number of points in x-direction of ARR to be contoured.
JEXT Number of points in y-direction of ARR to be contoured.
XLEN X-direction length of plotting area.
YLEN Y-direction length of plotting area.
CVAL Array containing the values to be used for contour intervals (1 toNVAL). CVAL must be dimensioned with a dimension of at least 1.Unlike subroutine CONREC, NVAL cannot equal 0.
GRYLEV Array dimensioned (NVAL) containing the grayscale values for eachof the contour levels. Regions less than or equal to the correspondingcontour value CVAL are filled with the corresponding grayscalevalues. Grayscale values range from 0. (black) to 1.0 (white).
NVAL Number of contour intervals. NVAL must be less than or equal to100, and unlike in CONREC, NVAL cannot equal 0.
IOFFP Flag indicating that grid boxes whose vertices have the value SPVALare to be ignored during contouring.
SPVAL Special value denoting which grid boxes are to be ignored duringcontouring.
Example: CONFILL
Sample code:
do 10 j=1,10 do 10 i=1,10 f(i,j)=i*j xlen=5. ylen=5. nval=6 do 20 n=1,nval cval(n)=(n-1)*20 if(cval(n).le.20.) then grylev(n)=.3 elseif(cval(n).le.60.) then grylev(n)=.6 else grylev(n)=.9 endif continue call confill(f,10,10,10,xlen,ylen,cval,grylev,nval,ioffp,spval)
Code to draw grid boxes not shown.
Sample code:
10
20
CONREC
PURPOSE CONREC draws contour plots of a two-dimensional array of regularlyspaced data.
ARR Two-dimensional array containing regularly spaced data to becontoured. CONREC assumes ARR(1,1) is located at the lower leftcorner of the plot. Data points ARR(1,1) through ARR(IEXT,JEXT) arecontoured in an area XLEN x YLEN.
IMAX The first dimension of ARR in the calling program.
IEXT Number of points in x-direction of ARR to be contoured.
JEXT Number of points in y-direction of ARR to be contoured.
XLEN X-direction length of plotting area.
YLEN Y-direction length of plotting area.
CVAL Array containing the values to be used for contour intervals (1 toNVAL). CVAL must be dimensioned with a dimension of at least 1.If NVAL = 0, the individual contour values are automatically com-puted.
NVAL Number of contour intervals. If NVAL = 0, the number of contourintervals and the contour interval values are automatically calculated.This is helpful if the range of data values is not known beforehand.NVAL must be less than or equal to 100.
Special features of CONREC:
If NVAL < 0, only high and lows are plotted instead of contours.
Common block CONPAR is used to control various characteristics of the contourplot from the calling program. The variables in CONPAR are shown below, alongwith their default values:
ISPEC If 0, variables in CONPAR have no effect. Default = 0.
IOFFP If 1, you can specify regions not to contour by using SPVAL. Gridboxes with any corner values equal to SPVAL are not contoured.Default = 0.
SPVAL Special value to denote areas not to contour (usually set to 999.). De-fault = 0.
ILEGG If 0, legend below contour plot showing contour values, scale factors,etc. will not be printed. Default = 1.
ILABB If 0, contour labels are not plotted. Default = 1.
NHII If 0, H and L mark relative highs and lows, with the data valueplotted underneath the symbol.
If > 0, values are plotted at each array point.
If < 0, neither of the above is done.
Default = 0.
NDECCN Number of digits to the right of the decimal point in the contourlabels. Default = 1.
NLBLL Number of unlabeled contours between labelled contours. Default =3.
LSCAL If LSCAL = 0, the contours are scaled such that 0 < labeled values <100. If LSCAL = 1, the contours are not scaled, i.e. the contour valuesare the actual data values. Default = 0.
LDASH Specifies whether contours are solid (LDASH = 0) or dashed (LDASHNE 0). If LDASH is not equal to 0, then LDASH specifies the type ofdash line to use to draw the contours. The numeric value of LDASHis the number of times the dashed pattern (solid line/blank space) isrepeated per inch. Default= 0.
HGTLAB Specifies the height of contour labels. If HGTLAB=0, the height of thecontours is .11 inches.
XARR Array containing the x-coordinates of the points to be connected.
YARR Array containing the y-coordinates of the points to be connected.
NPTS Number of points in the curve.
THK Thickness of the curve. If THK = 0., the current linewidth is used.
CLOSER Logical variable. If CLOSER = .TRUE., the last point in the data arraysis connected to the first point, i.e. the curve is closed; otherwise, thecurve is open.
XARR Array containing the x-coordinates of the points to be connected.
YARR Array containing the y-coordinates of the points to be connected.
NPTS Number of points in the curve.
IDSHPN Dashed pattern of the line used to connect the data points. IDSHPN isspecified as the number of times the dashed pattern (solid line/blankspace) is repeated per inch.
THK Thickness of the dashes in the curve. If THK = 0., the current linewidth is used.
PURPOSE DSHLIN connects two points using a line with a specified dash pattern.
SYNTAX CALL DSHLIN (X1, Y1, X2, Y2, IDSHPN, THK)
ARGUMENTS
X1,Y1 X,Y coordinates of first data point.
X2,Y2 X,Y coordinates of second data point.
IDSHPN Dashed pattern of the line used to connect the two data points.IDSHPN is specified as the number of times the dashed pattern (solidline/blank space) is repeated per inch.
THK Thickness of the dashes in the connecting line. If THK = 0., thecurrent line width is used.
XPP,YPP X,Y coordinates of the tip of the arrowhead.
DIR Direction of arrowhead, measured east from north.
AROLNP Length of arrowhead sides.
SPRANG Half the angular spread of arrowhead.
LOCXY Location of arrowhead pointLOCXY=1 XPP,YPP at arrowhead point (most commonly used)LOCXY=2 XPP, YPP at center of arrowhead.LOCXY=3 XPP,YPP at tail of arrowhead.
FILL Logical variable. If FILL= .TRUE., the arrowhead is filled; otherwise itis outlined.
c Outline shape perimetercall drwcrv( xa, ya, 5, .01, .true. )
(0., 0.)
FILRGN
PURPOSE FILRGN is the same as FILLBOX, except it restores the current gray levelafter filling.
SYNTAX CALL FILRGN (XARR, YARR, NPTS, GRY)
ARGUMENTS
XARR Array containing the X coordinates of the points forming the perime-ter of the shape to fill.
YARR Array containing the Y coordinates of the points forming the perime-ter of the shape to fill.
NPTS Number of points comprising the shape perimeter.
GRY Gray level of filled shape. GRY must lie between 0.(black) and 1.(white), inclusive.
Example: FILRGN
Sample code:
dimension xa(5), ya(5)data xa / 1., 2.5, 3., 4.25, 3. /data ya / 1., 2., 3.5, 3.25, .25 /call filrgn( xa, ya, 5, .7 )call setlw ( .01)
c Outline shape perimetercall drwcrv( xa, ya, 5, .01, .true. )
call setgry(0.) before drwcrv is not needed as in FILLBOX
Sample code:
Note:
(0., 0.)
FILRGNC
PURPOSE FILRGNC fills a region with the current gray level or color.
SYNTAX CALL FILRGNC (XARR, YARR, NPTS)
ARGUMENTS
XARR Array containing the X coordinates of the points forming theperimeter of the shape to fill.
YARR Array containing the Y coordinates of the points forming theperimeter of the shape to fill.
NPTS Number of points comprising the shape perimeter.
GREST
PURPOSE GREST calls the PostScript operator grestore. It is useful after establishingand using a clipping region when it is no longer needed.
SYNTAX CALL GREST
ARGUMENTS
NONE
GREST is used to restore the graphics state of a PostScript page. It is called after aclipping region has been established and is no longer needed. GREST is used inconjunction with GSAV.
XPP,YPP X,Y coordinates of the Greek symbol to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of Greek symbol to be plotted.
ICH Integer value between 1 and 50 corresponding to the desired Greeksymbol (see table below).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter is to be plotted.
NCHAR Number of characters to be plotted (should be set to 1).
MJUS Controls the justification of the character to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe plotted character.
If MJUS = 1, (XPP,YPP) denotes the position of the center of theplotted character.
If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the plotted character.
PostScript Greek Symbols
Α1
Β2
Γ3
∆4
Ε5
Ζ6
Η7
Θ8
Ι9
Κ10
Λ11
Μ12
Ν13
Ξ14
Ο15
Π16
Ρ17
Σ18
Τ19
ϒ20
Φ21
Χ22
Ψ23
Ω24
α25
β26
γ27
δ28
ε29
ζ30
η31
ϑ32
ι33
κ34
λ35
µ36
ν37
ξ38
ο39
π40
ρ41
σ42
τ43
υ44
ϕ45
χ46
ψ47
ω48
θ49
φ50
GSAV
PURPOSE GSAV calls the PostScript operator gsave. It is useful before establishingand using a clipping region.
SYNTAX CALL GSAV
ARGUMENTS
NONE
GSAV is used to save the graphics state of the PostScript page prior to defining aclipping region. After the clipping region is used, GREST is called to restore theoriginal graphics state.
HILITEC
PURPOSE HILITEC prints text surrounded by a rectangular box (color).
XPP,YPP X,Y coordinates of the number to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation
HEIGHT Height of number to be plotted.
FNUM Floating point number to be plotted.
ANG Angle, measured counterclockwise from the X-axis, at which thenumber is to be plotted.
NDEC Controls the plotted precision of FNUM.
If NDEC > 0, it specifies the number of digits to the right of thedecimal point, after rounding.If NDEC = 0, only the number's integer portion and a decimal pointare plotted, after rounding.If NDEC = -1, only the number's integer portion is plotted, afterrounding.
MJUS Controls the justification of the number to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe plotted number.If MJUS = 1, (XPP,YPP) denotes the position of the center of theplotted number.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the plotted number.
XPP,YPP X,Y coordinates of the number to be plotted. Plotting may be con-tinued from the end of a previously plotted character when used inconjunction with any of the subroutines which support continuation.
HEIGHT Height of number to be plotted.
FNUM Floating point number to be plotted.
ANG Angle, measured counterclockwise from the X-axis, at which thenumber is to be plotted.
NDEC Controls the plotted precision of FNUM.
If NDEC > 0, it specifies the number of digits to the right of thedecimal point, after rounding.If NDEC = 0, only the number's integer portion and a decimal pointare plotted, after rounding.If NDEC = -1, only the number's integer portion is plotted, afterrounding.
MJUS Controls the justification of the number to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe plotted number.If MJUS = 1, (XPP,YPP) denotes the position of the center of theplotted number.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the plotted number.
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which support continua-tion.
HEIGHT Height of character string to be plotted.
IBCD Character string to be plotted (Hollerith).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter string is to be plotted.
NCHAR Number of characters in the string to plot.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
Special feature of KEKSYM:
You can plot special characters, for example the characters in fonts Symbol andZapf Dingbats, by setting NCHAR=-999 and IBCD equal to the octal code of thecharacter you want to plot.
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which support continua-tion.
HEIGHT Height of character string to be plotted.
CSTR Character string to be plotted (Hollerith).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter string is to be plotted.
NCHAR Number of characters in the string to plot.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
Special feature of KEKSYMC:
You can plot special characters, for example the characters in fonts Symbol andZapf Dingbats, by setting NCHAR=-999 and CSTR equal to the octal code of thecharacter you want to plot. CSTR must be in single quotes.
KEKSYMO
PURPOSE KEKSYMO plots a character string; however, the characters are outlinedrather than filled (solid).
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of character string to be plotted.
IBCD Character string to be plotted (Hollerith).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter string is to be plotted.
NCHAR Number of characters in the string to plot.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
Special feature of KEKSYMO:
You can plot special characters, for example the characters in fonts Symbol andZapf Dingbats, by setting NCHAR=-999 and IBCD equal to the octal code of thecharacter you want to plot.
PURPOSE LENSTR is a function whose returned value is the number of characters inthe character string argument after trailing blanks have been removed.
SYNTAX LS = LENSTR(STRING, NDIM)
ARGUMENTS
STRING Character string variable.
NDIM Maximum length of STRING as stated in calling program.
LS Returned length of the character string STRING after trailing blankshave been removed.
NEWDEV
PURPOSE NEWDEV specifies a non-default filename which will contain theapplication program's output PostScript plot file.
SYNTAX CALL NEWDEV (FLNAME, NCHAR)
ARGUMENTS
FLNAME Character string or FORTRAN character variable which containsthe name of the output Postscript file.
NCHAR Number of characters in the filename.
For example,
CALL NEWDEV ('MYPLOT.DAT', 10)
NEWDEV is called only once per plotting session and must be called prior toPSINIT. If NEWDEV is not called, the name of the output PostScript file ispsplot.ps.
NUMBER
PURPOSE NUMBER is the same as KEKNUM with left justification.
SYNTAX CALL NUMBER (XPP, YPP, HEIGHT, FNUM, ANG, NDEC)
ARGUMENTS
Same as KEKNUM.
ONEHLF
PURPOSE ONEHLF plots the symbol ½ .
SYNTAX CALL ONEHLF (XPP, YPP, HEIGHT, ANG, MJUS)
ARGUMENTS
XPP,YPP X,Y coordinates of the symbol to be plotted.
HEIGHT Height of symbol to be plotted.
ANG Angle, measured counterclockwise from the X-axis, at which thesymbol is to be plotted.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of number to be plotted.
IBCD Character string to be plotted (Hollerith).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter string is to be plotted.
NCHAR Number of characters in the string to plot.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
PURPOSE OVERSBSP plots a subscripted and superscripted character string with anoverbar. The overbar extends to cover both the subscripts and superscripts.
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which support continua-tion.
HEIGHT Height of character string to be plotted.
IBCD Character string to be plotted (Hollerith).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter string is to be plotted.
NCHAR Number of characters in the string to plot.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
ISUB Hollerith character(s) comprising the subscript.
NSUB Number of characters in the subscript string.
ISUP Hollerith character(s) comprising the superscript.
NSUP Number of characters in the superscript string.
PURPOSE OVERSBSPG plots a subscripted and superscripted Greek symbol with anoverbar. The overbar extends to cover both the subscripts and superscripts.
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of symbol to be plotted.
ICH Integer value between 1 and 50 corresponding to the desired Greeksymbol (see table below Subroutine GRKSYM).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter string is to be plotted.
NCHAR Number of characters in the string to plot (should be set to 1).
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
ISUB Hollerith character(s) comprising the subscript.
NSUB Number of characters in the subscript string.
ISUP Hollerith character(s) comprising the superscript.
NSUP Number of characters in the superscript string.
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of character string to be plotted.
IBCD Character string to be plotted (Hollerith).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter string is to be plotted.
NCHAR Number of characters in the string to plot.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
ISUB Hollerith character(s) comprising the subscript.
NSUB Number of characters in the subscript string.Example: OVERSUB
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of the Greek symbol to be plotted.
ICH Integer value between 1 and 50 corresponding to the desired Greeksymbol (see table below Subroutine GRKSYM).
ANG Angle, measured counterclockwise from the X-axis, at which thesymbol is to be plotted.
NCHAR Number of characters in the string to plot (should be set to 1).
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe symbol.If MJUS = 1, (XPP,YPP) denotes the position of the center of thesymbol.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the symbol.
ISUB Hollerith character(s) comprising the subscript.
NSUB Number of characters in the subscript string.
XPP,YPP X,Y coordinates of the character string to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of character string to be plotted.
IBCD Character string to be plotted (Hollerith).
ANG Angle, measured counterclockwise from the X-axis, at which thecharacter string is to be plotted.
NCHAR Number of characters in the string to plot.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character string.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter string.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character string.
ISUP Hollerith character(s) comprising the superscript.
NSUP Number of characters in the superscript string.
XPP,YPP X,Y coordinates of the Greek symbol to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of the Greek symbol to be plotted.
ICH Integer value between 1 and 50 corresponding to the desired Greeksymbol (see table below Subroutine GRKSYM).
ANG Angle, measured counterclockwise from the X-axis, at which thesymbol is to be plotted.
NCHAR Number of characters in the string to plot (should be set to 1).
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe symbol.If MJUS = 1, (XPP,YPP) denotes the position of the center of thesymbol.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the symbol.
ISUP Hollerith character(s) comprising the superscript.
NSUP Number of characters in the superscript string.
XPP,YPP X,Y coordinates of the Greek symbol to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of symbol to be plotted.
ICH Integer value between 1 and 50 corresponding to the desired Greeksymbol (see table below Subroutine GRKSYM).
ANG Angle, measured counterclockwise from the X-axis, at which thesymbol is to be plotted.
NCHAR Number of characters in the string to plot (should be set to 1).
MJUS Controls the justification of the symbol to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe symbol.If MJUS = 1, (XPP,YPP) denotes the position of the center of thesymbol.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the symbol.
PURPOSE PLOT is the most fundamental user-level plotting command. It gives youdirect control of pen movement (to any X,Y coordinate position) and penstatus (up or down). Additionally, it allows you to re-define the currentplotting origin.
SYNTAX CALL PLOT (XPP, YPP, IPEN)
ARGUMENTS
XPP,YPP X,Y coordinates of the position to which the pen is to be moved. Anorigin may be established anywhere on or off the plotting surface, asexplained below for negative IPEN values.
IPEN A signed integer which controls pen status (up/down) and origindefinition.
If IPEN = 2, the pen is down during movement, thus drawing a visibleline.
If IPEN = 3, the pen is up during movement, thus changing the pen'scurrent position only.
If IPEN = -2 or -3, a new origin is defined at the position (XPP,YPP)after the movement is completed as if IPEN were positive. The logicalX,Y coordinates of the new pen position are set to (0,0), so that allsubsequent pen movements use this position as a reference point.
If IPEN = 999, the call to PLOT closes the output file. Thus, a call toPLOT with IPEN = 999 may be used only once in a given plottingsession, and if used, must be the last plotting command in the plottingsession. Calling PLOT with IPEN = 999 is identical to callingPLOTND (which see).
PURPOSE PLOTND closes the output PostScript plot file to terminate the current plotdefined by the user application program.
SYNTAX CALL PLOTND
ARGUMENTS
None
You must call PLOTND (or PLOT ( 0., 0., 999) ) as the last plotting call in theapplication program.
PLSMIN
PURPOSE PLSMIN plots the symbol ±.
SYNTAX CALL PLSMIN (XPP, YPP, HEIGHT, ANG, MJUS)
ARGUMENTS
XPP,YPP X,Y coordinates of the symbol to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of symbol to be plotted.
ANG Angle, measured counterclockwise from the X-axis, at which thesymbol is to be plotted.
MJUS Controls the justification of the character string to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character.
XPP,YPP X,Y coordinates of the symbol to be plotted. Plotting may becontinued from the end of a previously plotted character when usedin conjunction with any of the subroutines which supportcontinuation.
HEIGHT Height of symbol to be plotted.
ANG Angle, measured counterclockwise from the X-axis, at which thesymbol is to be plotted.
MJUS Controls the justification of the symbol to be plotted.
If MJUS = 0, (XPP,YPP) denotes the position of the lower left corner ofthe character.If MJUS = 1, (XPP,YPP) denotes the position of the center of thecharacter.If MJUS = 2, (XPP,YPP) denotes the position of the lower right cornerof the character.
PURPOSE PSINIT is called to begin a plotting session. It must be called before anyother plotting command, with the exception of NEWDEV.
SYNTAX CALL PSINIT (PRTRT)
ARGUMENTS
PRTRT Logical variable indicating the paper orientation. If PRTRT=.TRUE.,the paper is oriented in portrait mode, i.e. long side of page is vertical.If PRTRT=.false., the paper is oriented in landscape mode, i.e. longside of page is horizontal.
RECT
PURPOSE RECT draws a rectangle (or square).
SYNTAX CALL RECT (XX1, YY1, XX2, YY2, HEIGHT)
ARGUMENTS
XX1,YY1 X,Y coordinates of lower left corner of rectangle.
XX2,YY2 X,Y coordinates of lower right corner of rectangle.
PURPOSE SETCOLR sets the current red, green, and blue color levels.
SYNTAX CALL SETCOLR (RED, GREEN, BLUE)
ARGUMENTS
RED Red color saturation level, between 0. and 1.0.
GREEN Green color saturation level, between 0. and 1.0.
BLUE Blue color saturation level, between 0. and 1.0.
SETFNT
PURPOSE SETFNT sets the current font.
SYNTAX CALL SETFNT (NFONT)
ARGUMENTS
NFONT Number of desired font between 1 and 35 (see table below).
The fonts sets 29 (Symbol) and 35 (ZapfDingbats) require the octal code of thecharacter to be plotted. See the tables on the following pages for the character setsand corresponding octal code values for these two fonts.
NSUB, NSUP Number of different font sets needed for subscripts andsuperscripts, respectively.
NFNTSB, NFNTSP Arrays holding the font numbers 1 to NSET for subscriptsand superscripts, respectively.
ITITLESB, ITITLESP Arrays holding the octal codes for characters of fonts 29 or35; otherwise, holding text characters themselves.
NCHRSB, NCHRSP Number of characters of a given font for subscripts andsuperscripts, respectively. Usually one, but can be greaterthan one for fonts other than 29 and 35.
HEIGHT Height of the variable to be subscripted. It is not the heightof the subscript characters themselves.
ANG Angle of the subscripted variable.
Note: SUBSUPSP must be called immediately after the call to create thesubscripted variable.