home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 01e / libry31a.zip / LIBRY6.DOC < prev    next >
Text File  |  1987-01-21  |  10KB  |  261 lines

  1. .pa
  2.                                   PLOT
  3.  
  4. These  procedures  enable  you to do graphics from FORTRAN.  If you just
  5. want to make  a  plot  or  draw  a  figure  I  suggest  you  use  TPLOT.
  6. Considering  all  of  the options and procedures necessary to turn out a
  7. piece of graphics, I wouldn't  recommend  your  writing  your  own  plot
  8. package unless you have some very unusual, specific task in mind.  TPLOT
  9. is fairly extensive and has many options and is  quite  a  lengthy  code
  10. that took several years to debug.
  11.  
  12. There  is  only  one  function common to all graphics devices and that's
  13. drawing a  line  between  two  points.   I  do  everything  with  lines,
  14. including  drawing  characters.   This  might not look too good on a low
  15. resolution device;  but it's the  only  thing  you  can  count  on  when
  16. somebody  comes  out with a new device.  It is also the only way you can
  17. get enhancements like bigger or smaller and taller or fatter.   Besides,
  18. by  definition,  that's  all a pen plotter will do;  and that's what I'm
  19. most interested in - producing plots for reports.
  20.  
  21. Also I only do plots in absolute  raster  units.   The  lower  left-hand
  22. corner is always (0,0) as far as I am concerned!
  23.  
  24. These  plot  procedures  work  according  to   the   prescribed   device
  25. (designated  by  an  LU  number).  Each type of graphics device requires
  26. different commands.  These procedures  are  designed  so  that  this  is
  27. transparent.   You  just specify the LU and the rest is handled for you.
  28. The LUs are as follows.
  29.  
  30.           for this device use....................................this LU
  31.           HP-2623 B&W graphics terminal (low resolution)........... 2623
  32.           HP-2627 color graphics terminal (low resolution)......... 2623
  33.           HP-2648 B&W graphics terminal (low resolution)........... 2648
  34.           Tektronix-4014 graphics terminal (high resolution)....... 4014
  35.           Tektronix-4107 graphics terminal (medium resolution)..... 4107
  36.           HP-7470 two pen plotter (very high resolution)........... 7470
  37.           HP-7475 four pen plotter (very high resolution).......... 7475
  38.           HP-7550 eight pen plotter (very high resolution)......... 7475
  39.           IBM-PC 320X200 B&W graphics (very low resolution)........ 8086
  40.           HP-9872 six pen plotter (very high resolution)........... 9872
  41.  
  42. I just can't pass up this opportunity to say something about  resolution
  43. and  color...   Anyone  who  calls 1024X1024 pixels "high resolution" is
  44. nuts.  High resolution  is  at  least  4096X3112  pixels.   Some  people
  45. actually  call  terminals  with 512X360 pixels high resolution - this is
  46. probably an inside joke that I'm just not aware of.
  47.  
  48. There is also the matter of "how many colors"...  Black is not  a  color
  49. because  any terminal can display black when the plug is removed.  White
  50. is also not a "color" per se.  Colors are red,  blue,  etc.   It  really
  51. doesn't  make  a  hoot  of difference whether or not you can select from
  52. over 10 million colors if all you can get at any one time is 14+white.
  53. .pa
  54.                      QUICK LIST OF PLOT SUBROUTINES
  55.  
  56. ARROW:  draw an arrowhead
  57. BOX:    draw a box
  58. CIRCL:  draw a circle (or part of a circle)
  59. COLOR:  change color or pen
  60. DUMPIT: dump the graphics buffer
  61. LINE0:  draw a line
  62. NUMBS:  draw a number
  63. PATRN:  fill in a pattern
  64. PL0TS:  set/get flags
  65. QUITS:  terminate plot
  66. SETBUF: set buffer size
  67. START:  initiate plot
  68. SYMB0:  draw a symbol
  69. SYMBS:  draw a string of symbols
  70. WIPE:   clear graphics
  71. .pa
  72. NAME:     ARROW
  73. PURPOSE:  draw an arrowhead
  74. TYPE:     subroutine (far external)
  75. SYNTAX:   CALL ARROW(IX,IY,ISIZE,ANGLE,LU)
  76. INPUT:    IX,IY (INTEGER*2) location of tip in raster units
  77.           ISIZE (INTEGER*2) length in raster units
  78.           ANGLE (REAL*4) angle in degrees (zero is horizontal, 90 is up)
  79.           LU (INTEGER*2) see above list
  80. OUTPUT:   none
  81.  
  82.  
  83. NAME:     BOX
  84. PURPOSE:  draw a box
  85. TYPE:     subroutine (far external)
  86. SYNTAX:   CALL BOX(MINX,MINY,MAXX,MAXY,LU)
  87. INPUT:    MINX,MINY,MAXX,MAXY (INTEGER*2) location of lower left and
  88.           upper right corners of box in raster units
  89.           LU (INTEGER*2) see above list
  90. OUTPUT:   none
  91.  
  92.  
  93. NAME:     CIRCL
  94. PURPOSE:  draw a circle (or part of a circle)
  95. TYPE:     subroutine (far external)
  96. SYNTAX:   CALL CIRCL(IX,IY,IR,IDEG1,IDEG2,LU)
  97. INPUT:    IX,IY (INTEGER*2) location of center in raster units
  98.           IR (INTEGER*2) radius in raster units
  99.           IDEG1,IDEG2 (INTEGER*2) degrees where to start and end arc
  100.           (for a full circle use 0,360)
  101.           LU (INTEGER*2) see above list
  102. OUTPUT:   none
  103.  
  104.  
  105. NAME:     COLOR
  106. PURPOSE:  change color or pen
  107. TYPE:     subroutine (far external)
  108. SYNTAX:   CALL COLOR(IC,LU,IOPT)
  109. INPUT:    IC (INTEGER*2) desired color or pen
  110.           LU (INTEGER*2) see above list
  111.           IOPT (INTEGER*2) option (if IOPT=0 select color, if IOPT<0
  112.           select old color-1, if IOPT>0 select old color+1)
  113. OUTPUT:   none
  114.  
  115.  
  116. NAME:     DUMPIT
  117. PURPOSE:  dump the graphics buffer
  118. TYPE:     subroutine (far external)
  119. SYNTAX:   CALL DUMPIT(LU)
  120. INPUT:    LU (INTEGER*2) see above list
  121. OUTPUT:   none
  122.  
  123.  
  124. NAME:     LINE0
  125. PURPOSE:  draw a line
  126. TYPE:     subroutine (far external)
  127. SYNTAX:   CALL LINE0(IX1,IY1,IX2,IY2,LT,LU)
  128. INPUT:    IX1,IY1 (INTEGER*2) starting point in raster units
  129.           IX2,IY2 (INTEGER*2) ending point in raster units
  130.           LT (INTEGER*2) linetype (2 is solid, see TPLOT manual)
  131.           LU (INTEGER*2) see above list
  132. OUTPUT:   none
  133.  
  134.  
  135. NAME:     NUMBS
  136. PURPOSE:  draw a number
  137. TYPE:     subroutine (far external)
  138. SYNTAX:   CALL NUMBS(IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE,R,ND,NP,LU)
  139. INPUT:    IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE (see SYMB0)
  140.           R (REAL*4) number to be drawn
  141.           ND,NP (INTEGER*2) number of digits, number of decimal points
  142.           (this is just like an Fn.m format - F10.0 would be 10,0 - for
  143.           integer output use R=FLOAT(I) and NP=-1, e.g. for an I5 format
  144.           use 5,-1)
  145.           LU (INTEGER*2) see above list
  146. OUTPUT:   none
  147.  
  148.  
  149. NAME:     PATRN
  150. PURPOSE:  fill in a pattern
  151. TYPE:     subroutine (far external)
  152. SYNTAX:   CALL PATRN(IX,IY,NP,SL,NS,LT,LU)
  153. INPUT:    IX,IY (INTEGER*2) set of points defining polygonal region in
  154.           raster units
  155.           NP (INTEGER*2) number of points (for a triangular region NP=3)
  156.           SL (REAL*4) slope of the lines (tangent of the angle, zero is
  157.           horizontal)
  158.           NS (INTEGER*2) spacing between lines in raster units (note: if
  159.           you want to outline the region set NS=-NS)
  160.           LT (INTEGER*2) line type (2 is solid, refer to TPLOT manual
  161.           for other line types)
  162.           LU (INTEGER*2) see above list
  163. OUTPUT:   none
  164. NOTE:     this will fill any irregular convex/concave polygonal region
  165.  
  166.  
  167. NAME:     PL0TS (note zero "0" not oh "O")
  168. PURPOSE:  set/get flags
  169. TYPE:     subroutine (far external)
  170. SYNTAX:   CALL PL0TS(IOPT,I,J,L)
  171. INPUT:    IOPT (INTEGER*2) option
  172.             IOPT=1   set device=I LU=J
  173.             IOPT=2   return J=LU for device=I
  174.             IOPT=3   set IXOLD=I,IYOLD=J
  175.             IOPT=4   return I=IXOLD,J=IYOLD
  176.             IOPT=5   set ALTER=L
  177.             IOPT=6   return L=ALTER
  178.             IOPT=7   set TILT=L
  179.             IOPT=8   return L=TILT
  180.             IOPT=9   set IOVCOL=I
  181.             IOPT=10  return I=IOVCOL
  182.           I,J (INTEGER*2) depending on IOPT
  183.           L (LOGICAL*2) depending on IOPT
  184. OUTPUT:   J,L depending on IOPT
  185. NOTE:     TILT and ALTER are LOGICAL*2 switches that control the plot
  186.           orientation (TILT=.FALSE. is upright, TILT=.TRUE. is 90 on
  187.           its side) and special character interpretation respectively
  188.           refer to TPLOT manual for examples of TILT and ALTER
  189.  
  190.  
  191. NAME:     QUITS
  192. PURPOSE:  terminate plot
  193. TYPE:     subroutine (far external)
  194. SYNTAX:   CALL QUITS(LU,IOPT)
  195. INPUT:    LU (INTEGER*2) see above list
  196.           IOPT (INTEGER*2) option see START
  197. OUTPUT:   none
  198.  
  199.  
  200. NAME:     SETBUF
  201. PURPOSE:  set buffer size
  202. TYPE:     subroutine (far external)
  203. SYNTAX:   CALL SETBUF(NBUF)
  204. INPUT:    NBUF (INTEGER*2) number of bytes (default is 1K)
  205. OUTPUT:   none
  206.  
  207.  
  208. NAME:     START
  209. PURPOSE:  initiate plot
  210. TYPE:     subroutine (far external)
  211. SYNTAX:   CALL START(LU,IOPT)
  212. INPUT:    LU (INTEGER*2) see above list
  213.           IOPT (INTEGER*2) option
  214.           IOPT=0  is the usual
  215.           IOPT>0  on CRT will not clear screen before plotting (useful
  216.                   for plot-on-plot, can't do it on the PC)
  217.           IOPT=2  on an HP-9872 will give you a 11"X17" plot rather than
  218.                   8.5"X11"
  219.           there are others but they are too machine specific to detail
  220. OUTPUT:   none
  221.  
  222.  
  223. NAME:     SYMB0
  224. PURPOSE:  draw a symbol
  225. TYPE:     subroutine (far external)
  226. SYNTAX:   CALL SYMB0(IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE,IS,LU)
  227. INPUT:    IX,IY (INTEGER*2) location in raster units of lower left
  228.           corner of symbol
  229.           ISIZE (INTEGER*2) height of symbol in raster units
  230.           ASPECT (REAL*4) aspect (1 is normal, 2 is tall, .5 is short)
  231.           ANGLE (REAL*4) angle in degrees (0 is horizontal, 90 is up)
  232.           SLANT (REAL*4) slant in degrees (0 is upright, 45 is forward,
  233.           -45 is backward)
  234.           NSHADE (INTEGER*2) shading (0 is normal, 1 is dark, 2 is very
  235.           dark, 3 is ridiculous)
  236.           IS (INTEGER*2) character number (32 is blank, 64 is '@', 65
  237.           is 'A', etc. for ASCII, 65+128 is a greek alpha etc., 65+256
  238.           is the symbol 'A' which happens to be a box - refer to TPLOT
  239.           manual for list of symbols)
  240.           LU (INTEGER*2) see above list
  241. OUTPUT:   none
  242.  
  243.  
  244. NAME:     SYMBS
  245. PURPOSE:  draw a string of symbols
  246. TYPE:     subroutine (far external)
  247. SYNTAX:   CALL SYMBS(IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE,STRING,N,LU)
  248. INPUT:    IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE (see SYMB0)
  249.           STRING (CHARACTER*?) string to be drawn e.g. 'draw this'
  250.           N (INTEGER*2) number of characters in string
  251.           LU (INTEGER*2) see above list
  252. OUTPUT:   none
  253.  
  254.  
  255. NAME:     WIPE
  256. PURPOSE:  clear graphics
  257. TYPE:     subroutine (far external)
  258. SYNTAX:   CALL WIPE(LU)
  259. INPUT:    LU (INTEGER*2) see above list
  260. OUTPUT:   none
  261.