PLOT88
|
HOME |
EXAMPLE PROGRAMThis program illustrates some of the subroutine calls to the PLOT88 library. C************************************************************ C C Bell Curve example. C C************************************************************ C PROGRAM BELL C C... Maximum number of data points allowed. Parameter ( maxdat=13 ) C C... Provide room in the data arrays for the scale values. Parameter ( maxary=maxdat+2 ) C C... Length of X and Y axes in inches. Parameter ( xlen=6.0, ylen=4.0 ) C C... Line parameters. "inc" indicates that every point in C... the data arrays are plotted. "ic" is the centered symbol C... number (0-15). "0" indicates a square centered symbol. Parameter ( inc=1, ic=0, lt=1) C C... Origin of plot on page is up and over 1 inch. PARAMETER (xorg=1.0, yorg=1.0 ) C C... Height of axis title is 0.25 inches. PARAMETER ( hgt=0.25 ) C C... The X axis is drawn at zero degrees and the Y axis is C... drawn at 90 degrees. PARAMETER ( xang=0.0, yang=90.0 ) C C... X and Y origin for axes. PARAMETER ( xa=0.0, ya=0.0 ) C C... STAXIS parameters. "annhgt" = height of tic mark annotation. C... "tithgt" is the height of the axis title. "exphgt" is the height C... of the axis exponents. "ticlen" is the length of the tics and C... "ndeca" is the number of digits to the right of the decimal C... in the axis annotation. PARAMETER ( annhgt=0.15, tithgt=0.20, exphgt=0.1, ticlen=0.1) PARAMETER ( ndeca=1 ) C C... Ioport is COM1: at 9600 baud, Model is a HP plotter. PARAMETER ( ioport=0000, model=64 ) C C... Plot drawing at full size. PARAMETER ( fact=1. ) C C... Data arrays. REAL XDATA ( maxary ) , YDATA ( maxary ) C C... X and Y data arrays. DATA XDATA /-3.0,-2.5,-2.0,-1.5,-1.0,-0.5,0.0, - 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 0.0, 0.0/ DATA YDATA / .004,.018,.054,.130,.242,.352,.399, - .352,.242,.130,.054,.018,.004,0.0,0.0/ C -------------------------------------------------- C C Use PLOT88 to produce drawing. C C -------------------------------------------------- C C... Initialize PLOT88 Library CALL PLOTS ( 0, ioport, model ) C C... Set the factor size CALL FACTOR ( fact ) C C... Select duplex type font. CALL DUPLX C C... Reorigin plot up and over on page. CALL PLOT ( xorg, yorg, -3 ) C C... Scale X data CALL SCALE ( XDATA, xlen, maxdat, inc ) C C... Scale Y data CALL SCALE ( YDATA, ylen, maxdat, inc ) C C... STAXIS is an enhancement to the Industry Standard Plotting C... Packages (ISPP). With this routine it is possible to set the C... size of axis annotation and the number of digits to the C... right of the decimal. CALL STAXIS ( annhgt, tithgt, exphgt, ticlen, ndeca ) C C... Plot X axis - Tics on the inside. CALL AXIS ( xa, ya, 'Abscissa', -8, -xlen, xang, - XDATA(maxdat+1), XDATA(maxdat+2) ) C C... Plot Y axis - Tics on the inside CAll AXIS ( xa, ya,'Ordinate', 8, -ylen, yang, - YDATA(Maxdat+1), YDATA(maxdat+2) ) C C... Plot line CALL LINE ( xDATA, YDATA, maxdat, inc, LT, ic ) C... Get the length of the main title. CALL GETWID ( hgt, 'Bell Curve', 10, TITWID ) C C... Plot the title in the middle of the plot and 1/2 inch above the C... top of the Y axis. The string is drawn at 0 degrees (horizontal) XT = (xlen - titwid)/2. YT = (ylen + 0.5) CALL SYMBOL ( XT, YT, hgt, 'Bell Curve', xang, 10 ) C C... *** Produce the drawing *** CALL PLOT ( 0.0, 0.0, 999 ) C C... End of program STOP END |