home *** CD-ROM | disk | FTP | other *** search
- .pa
- PLOT
-
- These procedures enable you to do graphics from FORTRAN. If you just
- want to make a plot or draw a figure I suggest you use TPLOT.
- Considering all of the options and procedures necessary to turn out a
- piece of graphics, I wouldn't recommend your writing your own plot
- package unless you have some very unusual, specific task in mind. TPLOT
- is fairly extensive and has many options and is quite a lengthy code
- that took several years to debug.
-
- There is only one function common to all graphics devices and that's
- drawing a line between two points. I do everything with lines,
- including drawing characters. This might not look too good on a low
- resolution device; but it's the only thing you can count on when
- somebody comes out with a new device. It is also the only way you can
- get enhancements like bigger or smaller and taller or fatter. Besides,
- by definition, that's all a pen plotter will do; and that's what I'm
- most interested in - producing plots for reports.
-
- Also I only do plots in absolute raster units. The lower left-hand
- corner is always (0,0) as far as I am concerned!
-
- These plot procedures work according to the prescribed device
- (designated by an LU number). Each type of graphics device requires
- different commands. These procedures are designed so that this is
- transparent. You just specify the LU and the rest is handled for you.
- The LUs are as follows.
-
- for this device use....................................this LU
- HP-2623 B&W graphics terminal (low resolution)........... 2623
- HP-2627 color graphics terminal (low resolution)......... 2623
- HP-2648 B&W graphics terminal (low resolution)........... 2648
- Tektronix-4014 graphics terminal (high resolution)....... 4014
- Tektronix-4107 graphics terminal (medium resolution)..... 4107
- HP-7470 two pen plotter (very high resolution)........... 7470
- HP-7475 four pen plotter (very high resolution).......... 7475
- HP-7550 eight pen plotter (very high resolution)......... 7475
- IBM-PC 320X200 B&W graphics (very low resolution)........ 8086
- HP-9872 six pen plotter (very high resolution)........... 9872
-
- I just can't pass up this opportunity to say something about resolution
- and color... Anyone who calls 1024X1024 pixels "high resolution" is
- nuts. High resolution is at least 4096X3112 pixels. Some people
- actually call terminals with 512X360 pixels high resolution - this is
- probably an inside joke that I'm just not aware of.
-
- There is also the matter of "how many colors"... Black is not a color
- because any terminal can display black when the plug is removed. White
- is also not a "color" per se. Colors are red, blue, etc. It really
- doesn't make a hoot of difference whether or not you can select from
- over 10 million colors if all you can get at any one time is 14+white.
- .pa
- QUICK LIST OF PLOT SUBROUTINES
-
- ARROW: draw an arrowhead
- BOX: draw a box
- CIRCL: draw a circle (or part of a circle)
- COLOR: change color or pen
- DUMPIT: dump the graphics buffer
- LINE0: draw a line
- NUMBS: draw a number
- PATRN: fill in a pattern
- PL0TS: set/get flags
- QUITS: terminate plot
- SETBUF: set buffer size
- START: initiate plot
- SYMB0: draw a symbol
- SYMBS: draw a string of symbols
- WIPE: clear graphics
- .pa
- NAME: ARROW
- PURPOSE: draw an arrowhead
- TYPE: subroutine (far external)
- SYNTAX: CALL ARROW(IX,IY,ISIZE,ANGLE,LU)
- INPUT: IX,IY (INTEGER*2) location of tip in raster units
- ISIZE (INTEGER*2) length in raster units
- ANGLE (REAL*4) angle in degrees (zero is horizontal, 90 is up)
- LU (INTEGER*2) see above list
- OUTPUT: none
-
-
- NAME: BOX
- PURPOSE: draw a box
- TYPE: subroutine (far external)
- SYNTAX: CALL BOX(MINX,MINY,MAXX,MAXY,LU)
- INPUT: MINX,MINY,MAXX,MAXY (INTEGER*2) location of lower left and
- upper right corners of box in raster units
- LU (INTEGER*2) see above list
- OUTPUT: none
-
-
- NAME: CIRCL
- PURPOSE: draw a circle (or part of a circle)
- TYPE: subroutine (far external)
- SYNTAX: CALL CIRCL(IX,IY,IR,IDEG1,IDEG2,LU)
- INPUT: IX,IY (INTEGER*2) location of center in raster units
- IR (INTEGER*2) radius in raster units
- IDEG1,IDEG2 (INTEGER*2) degrees where to start and end arc
- (for a full circle use 0,360)
- LU (INTEGER*2) see above list
- OUTPUT: none
-
-
- NAME: COLOR
- PURPOSE: change color or pen
- TYPE: subroutine (far external)
- SYNTAX: CALL COLOR(IC,LU,IOPT)
- INPUT: IC (INTEGER*2) desired color or pen
- LU (INTEGER*2) see above list
- IOPT (INTEGER*2) option (if IOPT=0 select color, if IOPT<0
- select old color-1, if IOPT>0 select old color+1)
- OUTPUT: none
-
-
- NAME: DUMPIT
- PURPOSE: dump the graphics buffer
- TYPE: subroutine (far external)
- SYNTAX: CALL DUMPIT(LU)
- INPUT: LU (INTEGER*2) see above list
- OUTPUT: none
-
-
- NAME: LINE0
- PURPOSE: draw a line
- TYPE: subroutine (far external)
- SYNTAX: CALL LINE0(IX1,IY1,IX2,IY2,LT,LU)
- INPUT: IX1,IY1 (INTEGER*2) starting point in raster units
- IX2,IY2 (INTEGER*2) ending point in raster units
- LT (INTEGER*2) linetype (2 is solid, see TPLOT manual)
- LU (INTEGER*2) see above list
- OUTPUT: none
-
-
- NAME: NUMBS
- PURPOSE: draw a number
- TYPE: subroutine (far external)
- SYNTAX: CALL NUMBS(IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE,R,ND,NP,LU)
- INPUT: IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE (see SYMB0)
- R (REAL*4) number to be drawn
- ND,NP (INTEGER*2) number of digits, number of decimal points
- (this is just like an Fn.m format - F10.0 would be 10,0 - for
- integer output use R=FLOAT(I) and NP=-1, e.g. for an I5 format
- use 5,-1)
- LU (INTEGER*2) see above list
- OUTPUT: none
-
-
- NAME: PATRN
- PURPOSE: fill in a pattern
- TYPE: subroutine (far external)
- SYNTAX: CALL PATRN(IX,IY,NP,SL,NS,LT,LU)
- INPUT: IX,IY (INTEGER*2) set of points defining polygonal region in
- raster units
- NP (INTEGER*2) number of points (for a triangular region NP=3)
- SL (REAL*4) slope of the lines (tangent of the angle, zero is
- horizontal)
- NS (INTEGER*2) spacing between lines in raster units (note: if
- you want to outline the region set NS=-NS)
- LT (INTEGER*2) line type (2 is solid, refer to TPLOT manual
- for other line types)
- LU (INTEGER*2) see above list
- OUTPUT: none
- NOTE: this will fill any irregular convex/concave polygonal region
-
-
- NAME: PL0TS (note zero "0" not oh "O")
- PURPOSE: set/get flags
- TYPE: subroutine (far external)
- SYNTAX: CALL PL0TS(IOPT,I,J,L)
- INPUT: IOPT (INTEGER*2) option
- IOPT=1 set device=I LU=J
- IOPT=2 return J=LU for device=I
- IOPT=3 set IXOLD=I,IYOLD=J
- IOPT=4 return I=IXOLD,J=IYOLD
- IOPT=5 set ALTER=L
- IOPT=6 return L=ALTER
- IOPT=7 set TILT=L
- IOPT=8 return L=TILT
- IOPT=9 set IOVCOL=I
- IOPT=10 return I=IOVCOL
- I,J (INTEGER*2) depending on IOPT
- L (LOGICAL*2) depending on IOPT
- OUTPUT: J,L depending on IOPT
- NOTE: TILT and ALTER are LOGICAL*2 switches that control the plot
- orientation (TILT=.FALSE. is upright, TILT=.TRUE. is 90 on
- its side) and special character interpretation respectively
- refer to TPLOT manual for examples of TILT and ALTER
-
-
- NAME: QUITS
- PURPOSE: terminate plot
- TYPE: subroutine (far external)
- SYNTAX: CALL QUITS(LU,IOPT)
- INPUT: LU (INTEGER*2) see above list
- IOPT (INTEGER*2) option see START
- OUTPUT: none
-
-
- NAME: SETBUF
- PURPOSE: set buffer size
- TYPE: subroutine (far external)
- SYNTAX: CALL SETBUF(NBUF)
- INPUT: NBUF (INTEGER*2) number of bytes (default is 1K)
- OUTPUT: none
-
-
- NAME: START
- PURPOSE: initiate plot
- TYPE: subroutine (far external)
- SYNTAX: CALL START(LU,IOPT)
- INPUT: LU (INTEGER*2) see above list
- IOPT (INTEGER*2) option
- IOPT=0 is the usual
- IOPT>0 on CRT will not clear screen before plotting (useful
- for plot-on-plot, can't do it on the PC)
- IOPT=2 on an HP-9872 will give you a 11"X17" plot rather than
- 8.5"X11"
- there are others but they are too machine specific to detail
- OUTPUT: none
-
-
- NAME: SYMB0
- PURPOSE: draw a symbol
- TYPE: subroutine (far external)
- SYNTAX: CALL SYMB0(IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE,IS,LU)
- INPUT: IX,IY (INTEGER*2) location in raster units of lower left
- corner of symbol
- ISIZE (INTEGER*2) height of symbol in raster units
- ASPECT (REAL*4) aspect (1 is normal, 2 is tall, .5 is short)
- ANGLE (REAL*4) angle in degrees (0 is horizontal, 90 is up)
- SLANT (REAL*4) slant in degrees (0 is upright, 45 is forward,
- -45 is backward)
- NSHADE (INTEGER*2) shading (0 is normal, 1 is dark, 2 is very
- dark, 3 is ridiculous)
- IS (INTEGER*2) character number (32 is blank, 64 is '@', 65
- is 'A', etc. for ASCII, 65+128 is a greek alpha etc., 65+256
- is the symbol 'A' which happens to be a box - refer to TPLOT
- manual for list of symbols)
- LU (INTEGER*2) see above list
- OUTPUT: none
-
-
- NAME: SYMBS
- PURPOSE: draw a string of symbols
- TYPE: subroutine (far external)
- SYNTAX: CALL SYMBS(IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE,STRING,N,LU)
- INPUT: IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE (see SYMB0)
- STRING (CHARACTER*?) string to be drawn e.g. 'draw this'
- N (INTEGER*2) number of characters in string
- LU (INTEGER*2) see above list
- OUTPUT: none
-
-
- NAME: WIPE
- PURPOSE: clear graphics
- TYPE: subroutine (far external)
- SYNTAX: CALL WIPE(LU)
- INPUT: LU (INTEGER*2) see above list
- OUTPUT: none