home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / fortran / library / library / libry6.doc < prev    next >
Text File  |  1989-11-10  |  11KB  |  264 lines

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