PSPLOT subroutines are designed to produce Postscript files for graphic output. They simulate micro-computer graphics and are designed to allow plotting in the simplest mannner possible. These routines are similar, but not identical, to the EZXPLOT routines. NOTE: The file is written to Fortran unit 17; do not use this unit number in your program. These routines are contained in /home/shearer/PROG/PLOT/psplot.f To use them, bind your program with psplotlib.a (f77) or psplotlib_f90.a (IBM F90 compiler). Report bugs to pshearer@ucsd.edu LIST OF SUBROUTINES PSANG(ang) sets the angle for drawing text (degrees counterclockwise from horizontal, 0 is normal). It is a good idea to call PSANG(0.) when you are finished with any non-zero angles. PSAXES(xtic,xlab,xticl,xfrmt,ytic,ylab,yticl,yfrmt) makes a frame with tics and tic labels as specified. The position of the frame is assumed to be defined by the corners set in WINDOW. xtic = small tic increment ylab = numbered tic increment (length is 2*nxtic) xticl = small tic length (inches) xfrmt = format for x-axis numbers (see PSNUMB for format details) etc. for y Note: Don't make tic increments negative even for reversed scale plots. PSAXES should figure it out correctly. If you don't want tic labels or a particular axis, set xfrmt or yfrmt to a blank character, i.e. to ' '. PSDRAW(x,y) draws a line from the current pen position to (x,y) and updates pen position (in user units as defined by PSWIND). A stroke command is executed after every 500 PSMOVE and PSDRAW commands. To make sure you get your final points, call PSPS('stroke') just before you finish. To move to a new pen position without incrementing the stoke counter, see PSPOS. PSEND terminates the plot. PSEND_BB(x1,x2,y1,y2) terminates plot with user-specified bounding box. A bounding box is required by some applications. Here you must specify this manually. The coordinates are inches from the lower left corner (do NOT use coordinates defined by PSWIND). PSIMAG(ibuf,nx,ny,icol) displays a bitmap using either image (grayscale) or colorimage (color). ibuf = integer*2 array (one-dimensional) containing bitmap 1 number per pixel for grayscale 3 numbers per pixel for color (RGB multiplexed) values must be from 0 to 255 (0=black, 255=white or color) 1st pixel is at lower left, last at upper right image is formed by rows from bottom to top nx = number of columns of ibuf (pixels) ny = number of rows of ibuf (pixels) icol = 0 for grayscale = 1 for color NOTE: ibuf is a 1-D array. Bitmap is stored by rows from bottom, e.g. 7 8 9 4 5 6 ibuf indices are shown for 3x3 bitmap 1 2 3 subroutine TORGB(hue,sat,bri,red,green,blue) can be used to convert from (hue,sat,bri) to RGB PSBOX(x1,x2,y1,y2,gray) draws filled in grayshade box (gray=0 for black, =1 for white) PSCBOX(x1,x2,y1,y2,hue,sat,bri) draws filled in color box PSCOL(icol) sets color 0 = white 1 = black 2 = red 3 = blue 4 = yellow 5 = green 6 = brown 7 = purple 8 = cyan 9 = magenta 10 = orange 11 = light green 12 = pink 13 = blue-green 14 = yellow-green 15 = gray (50%) PSFILE(filename) initializes PSPLOT subroutines and creates a Postscript output file called filename. PSFONT(text) specifies that current font is text text = 'h10' for 10-point Helvetica = 'h14' for 14-point Helvetica = 'hb12' for 12-point Helvetica-Bold = etc. Note: Only Helvetica (h8,h9,h10,h11,h12,h14,h18,h24) and Helvetica-Bold (hb8,hb9,hb10,hb11,hb12,hb14,hb18,hb24) are available with the PSFONT routine. Other fonts can be set directly (but note scaling to 1/000 inch scale) with the PSPS subroutine or by adding the appropriate abbreviation to the PSINIT file. PSFRAM(x1,x2,y1,y2) draws a box with lower left corner (x1,y1) and upper right corner (x2,y2). PSGRAY(graylevel) sets grayscale (0=black, 1=white) PSHSB(hue,sat,bri) sets Postscript hue, saturation, brightness PSLAB(text) plots the string 'text' at the current pen position in a way determined by the current LORG setting. The font can be changed with the PSFONT command. The direction can be changed with PSANG. PSLAND rotates plot orientation to horizontal for standard 8.5 x 11" paper. This should be called immediately after PSFILE. It has no arguments. PSLAX(xlabel,xoff,ylabel,yoff) puts x and y axes labels on axes Inputs: xlabel = x-axis label xoff = inches to offset label etc. PSLINE(flinewidth) sets line width PSLORG(n) allows the user to specify how text or numbers will be centered around the current pen position. This will affect PSLAB and PSNUMB. 7xxxxxx8xxxxxx9 nlorg= 4 5 6 centers block as shown 1xxxxxx2xxxxxx3 PSMOVE(x,y) changes current pen position to (x,y) (in user units as defined by PSWIND). The stroke counter is incremented (see PSDRAW). To move to a new pen position without incrementing the stoke counter, see PSPOS. PSNICE(xmin,xmax,tic1,tic2) returns convenient tic increments tic1 and tic2, given xmin and xmax. This is a utility program to find appropriate values of tic1 and tic2 for use by PSAXES. PSNOTE(text) writes text in lower left corner of plot PSNUMB(fnum,fmtstr) plots the real number at the current pen position according to format . Formats may be 'F', 'E', or 'I'. Number to be plotted must have 20 or fewer digits including signs, decimal point, and any exponent. FORMAT SHOULD NOT BE ENCLOSED IN PARENTHESIS. Note: fnum must be passed to NUMB as a real number. However note that it can be plotted as an integer by using an I format. PSPOS(x,y) sets current pen position to (x,y) without incrementing stroke counter. PSPS(text) writes text to output file. PSPS can be used to write any desired Postscript command. Example: call PSPS('stroke') PSSYMB(n,symsize) plots symbol at the current pen position. n = 1 -- + = 2 -- square = 3 -- triangle = 4 -- inverted triangle = 5 -- X = 6 -- diamond = 7 -- hexagon = 8 -- circle size2 = symbol height in inches NOTE: Negative symbol numbers make filled symbols PSTIC(x,y,nup) draws a line (or merely moves) from the current pen position to a position x inches to the right and y inches up. nup = 0 -- move without drawing line nup = 1 -- draw line PSTIC is useful for drawing tic marks and adjusting label postions on plots when absolute (inches) motions are desired, since user units (defined by WINDOW) are not used. NOTE: x,y can be negative. PSTIT(title,yoff) puts title above axes title = title yoff = inches to offset title from top of plot PSWIND(x1,x2,y1,y2,x3,x4,y3,y4) defines a user scale for plotting which is used by most of the other PSPLOT subroutines. (x1,y1) and (x2,y2) define the lower left and upper right corner of the plot area on the screen in inches. (x3,y3) and (x4,y4) define the corresponding values at these points for the user scale. All other points will be linearly interpolated using these values. Note: PSWIND and all PSPLOT subroutines assume that the y scale is from bottom. NOTE: Postscript differs from most pen type plot libraries in that the 'stroke' command must be used to actually draw the current path onto the page. This takes some getting used to. Call PSPS('stroke') should be used before any parameter such as line width is changed. The PSDRAW command does not send a stroke command until 500 PSMOVE and PSDRAW commands are accumulated. call PSPS('[60] 0 setdash') for dashed line call PSPS('[] 0 setdash') for normal line