C      GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
C      G                             G
C      G    GENEVA GROUP GRAPHICS    G 
C      G                             G
C      G      AVAILABLE ROUTINES     G
C      G                             G
C      GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
C
C   version of 2 may 2000
 
C ******** SUBROUTINE BEGIN_GGG *********
        CALL BEGIN_GGG(name)
C  The statement CALL BEGIN_GGG('name')  initiates
C  the environment, which produces two parts of a ps-file
C  'name.vor' and 'name.add'; concatenating 'name.vor' and
C  'name.add' yields the ps-file 'name.ps'. 
C  GGG also produces a LaTeX input file 'name.inp'
C  to be inserted as follows in the LaTeX file:
C  \begin{figure}[h]
C    \centering
C     \GGGinput{directory/}{name}
C    \caption{Test for GGGnugnat}\label{Gnugnat}
C  \end{figure}


C ******** SUBROUTINE END_GGG ********
        CALL END_GGG 
C  writes the necessary marcos and produces the final files.


C ******** SUBROUTINE MAGNIFICATION ********
        CALL MAGNIFICATION(ISCALE)
C  Reduces Picture by 1.2**iscale to obtain correct
C  size after LaTeX's \magnification


C *********** SUBROUTINE MICKEY_MOUSE ***********
        CALL MICKEY_MOUSE(I,J,XMIN,XMAX,YMIN,YMAX)
C  places a picture
C  of size SIZE(1),SIZE(2) cm (in COMMON/SIZES/SIZE(4))
C  on the paper like in a Mickey Mouse comics. 
C  Can be used several times. I,J are the positions
C  like the indices of a matrix.
C  NEGATIVE values for I (-1,-2,...) fill the matrix from BELOW.
C  XMIN,XMAX,YMIN,YMAX are the bounds of the local coordinates.
C  SIZE(3),SIZE(4) are the distances between individual pictures.


C *********** SUBROUTINE MASOG ***********
        CALL MASOG(XMIN,XMAX,YMIN,YMAX)
C  similar as MYCKEY_MOUSE, but with automatic choice of i,j


C ************ SUBROUTINE PAPER_CORNERS and XY_LIMITS ***********
      CALL PAPER_CORNERS(U1,V1,U2,V2)
      CALL XY_LIMITS(XMIN,XMAX,YMIN,YMAX)
C  useful for several picture of different sizes: first
C  define coordinates of (left-lower, right upper) paper
C  corners in cm, then xy-limits of local coordinates.


C ************ SUBROUTINE SCALE_CHAR *********
        CALL SCALE_CHAR(SCALE)
C  set character size for TEXT and axes LABELing
C  (standard =1.)
C

C ************   SUBROUTINE THICK_PIXEL *********
        CALL THICK_PIXEL(ITHICK)
C  set line thickness in pixels (standard 2 or 4).
C

C ********* SUBROUTINE SELECT_LINE_TYPE *********
        CALL SELECT_LINE_TYPE(ITYPE)
C  ITYPE=0   .       .     (DOTS AT OUTPUT POINTS)
C  ITYPE=1   .   .   .   .
C  ITYPE=2   __  __  __  __
C  ITYPE=3   ___ ___ ___ ___
C  ITYPE=4   ___.___.___.___.
C  ITYPE=5   ___-___-___-___-
C  ITYPE=6   __--__--__--__--
C  ITYPE=7   _______________ (continuous line) 


C ********* SUBROUTINE AXEX ***********
        CALL AXEX(X0,Y0,X1,X2,XD,K)
        CALL AXEY(X0,Y0,Y1,Y2,YD,K)
        CALL LABEL_X(X0,Y0,X1,X2,XD,IDIGIT)
        CALL LABEL_Y(X0,Y0,Y1,Y2,YD,IDIGIT)
C ----- drawing the axes -------
C  CALL AXEX(XORIG,YORIG,XMIN,XMAX,XINCR,KX) draws x-axix with
C  XORIG,YORIG position of origin, XMIN,XMAX delimiters, XINCR
C  distance of large graduations, KX number of subgraduations.
C  CALL LABEL_X(XORIG,YORIG,XMIN,XMAX,XINCR,IDIGIT) writes labels,
C  IDIGIT is number of digits,

C ********* SUBROUTINE LABEL_X_W ***********
        CALL LABEL_X_W(X0,Y0,X1,X2,XD,IDIGIT)
        CALL LABEL_Y_W(X0,Y0,Y1,Y2,YD,IDIGIT)
same as LABEL_X, LABEL_Y, but with letters in white boxes

c ************* SUBROUTINE LOGAX_X,LOGAX_Y  *****************
        CALL LOGAX_X(X0,Y0,X1,X2,KDEL,KGRAD)
        CALL LOGAX_Y(X0,Y0,Y1,Y2,KDEL,KGRAD)
C  logarithmical axes with labels.  
C  possible values of  KDEL=1,2,3,4,...
C  possible values of KGRAD=-1,0,1.


C ********* SUBROUTINE FRAME ***********
        CALL FRAME
C  draws frame


C ******** SUBROUTINE GREATER_BOUNDINGBOX ********
      CALL GREATER_BOUNDINGBOX(U1GR,U2GR,V1GR,V2GR)
c ---- correct bounding box (LEFT,RIGHT,DOWN,UP; IN CM)----
C  for fine adjustment of the picture inside the text


C *********      SUBROUTINE SETGRAY  *********
      CALL SETGRAY(GRAY)
C  puts overall plotting gray tone, for example to draw
C  "white" lines above black ones.
C

C *********      SUBROUTINE COLOR, RGB_COLOR  *********
      CALL COLOR(COL)
      CALL RGB_COLOR(RED,GREEN,BLUE)
C  set plotting color; choices for COL: 'blue','green',
C  'red','pink','violet','yellow','orange'.
C  RED,GREEN,BLUE are three real values (between 0 and 1)
C  indicating brightness.

C
C ********* SUBROUTINE LINE ***********
        CALL LINE(XB,YB,XE,YE)
C  CALL LINE(XB,YB,XE,YE) draws a line connecting XB,YB with XE,YE.


C ********* SUBROUTINE LINE_OPEN ***********
        CALL LINE_OPEN(XB,YB,XE,YE)
C  same as LINE, but without control of drawing box

C ********* SUBROUTINE LING ***********
        CALL LING(XDES,YDES,N)
C ----- drawing a curve -------
C  CALL LING(XDES,YDES,NDES) connects NDES points with
C  given coordinates XDES(I),YDES(I),I=1,NDES.


C ********* SUBROUTINE LING_OPEN ***********
        CALL LING_OPEN(XDES,YDES,N)
C  same as LING, but without control of drawing box, for
C  drawing lines outside the box.
C

C ********* SUBROUTINE ARROW ***********
        CALL ARROW(XB,YB,XE,YE,AMM)
C ----- draw an arrow -----
C  has same arguments as LINE, with
C  AMM indicating size of arrow tip.


C ********* SUBROUTINE SHY_ARROW ***********
        CALL SHY_ARROW(XB,YB,XE,YE,AMM,PERCENT)
C ----- draw an arrow -----
C  has same arguments as AROW, but cuts off (100-PERCENT)/2.
C  of the length at both sides. If |PERCENT|\le 1, it
C  is replaced by 100*PERCENT. 


C ********* SUBROUTINE LINGARROW ***********
        CALL LINGARROW(XDES,YDES,NDES,AMM)
C  drawing polygons with an arrow at the end (for
C  drawing flows, for example)
        CALL LINGARROWS(XDES,YDES,NDES,AMM,INTER)
C draws MORE arrows beginning from end (at distance "INTER")

C ********* SUBROUTINE CLOSE_FILL ET RGB_CLOSE_FILL ***********
        CALL CLOSE_FILL(XDES,YDES,NDES,GREY,STROKE)
C ----- fills a surface -----
C  CALL CLOSE_FILL(XDES,YDES,NDES,GREY,.TRUE.) fills the surface
C  delimited by XDES(I),YDES(I),I=1,NDES with grey tone. GREY 
C  is the brightness (0=black, 1=white). If the logical .TRUE.
C  is replaced by .FALSE., there is no boundary line drawn. 
         CALL RGB_CLOSE_FILL(XDES,YDES,NDES,RED,GREEN,BLUE,STROKE)
C  does the same in color.


C ********* SUBROUTINE BUBBLE ***********
      CALL BUBBLE(XX,YY,AMMBIG,GREY,SYM)
C ----- draws a symbol -------
C  CALL BUBBLE(X,Y,AMM,GREY,SYM): X,Y is the position,
C  AMM size approximately in mm, GREY (between 0 and 1)
C  brightness of filling, SYM form of symbol with many choices:
C  'circle','square','losange','xstar','pstar','utri','dtri','umtri',
C  'dmtri','hardy','laurel','mpent','mhex','pent','hex','mmhex'.
c 

C ********* SUBROUTINE RGB_BUBBLE ***********
      CALL RGB_BUBBLE(XX,YY,AMMBIG,RED,GREEN,BLUE,SYM)
C ---- a colored symbol ------
C  the parameter GREY in BUBBLE is replaced by three
C 

C ********* SUBROUTINE BUBBLE_OPEN ***********
      CALL BUBBLE_OPEN(XX,YY,AMMBIG,GREY,SYM)
C  same as BUBBLE, but without control of drawing box

 
C ********* SUBROUTINE BUBBLES ***********
      CALL BUBBLES(XDES,YDES,N1,N2,NDIF,AMMBIG,AMMSML,GREY,SYM)
C  draws many BUBBLES of two different sizes 
C  at places XDES(I),YDES(I).


C ********* SUBROUTINE BUBBLES_OPEN ***********
      CALL BUBBLES_OPEN(
     &             XDES,YDES,N1,N2,NDIF,AMMBIG,AMMSML,GREY,SYM)
C  same as before, without control of drawing box
c 


C ********** SUBROUTINE TEXT_LATEX ***********
        CALL TEXT_LATEX(X,Y,ALAM,AMU,CHAR)
        CALL TEXT_LATEX_W(X,Y,ALAM,AMU,CHAR)
        CALL TEXT_RELAD_LATEX(X,Y,ALAM,AMU,CHAR)
        CALL TEXT_RELAD_LATEX_W(X,Y,ALAM,AMU,CHAR)
        CALL THICK_BORDER(THICKNESS) 
C ------ write LaTeX formulas inside the picture ----
C  CALL TEXT_LATEX(X,Y,ALAM,AMU,CHAR) writes LaTeX formula CHAR
C  at position X,Y. The parameters ALAM,AMU are the relative
C  coordinates (between 0 and 1) of the position point X,Y
C  inside the box and allow all types of centering.
C  Values outside the interval [0,1] are also possible.
C  Many compilers require two '\\' to produce one '\'.
C  CALL TEXT_LATEX_W(X,Y,ALAM,AMU,CHAR) 
C  puts the formula inside a white box. 
C  CALL TEXT_RELAD_LATEX(X,Y,ALAM,AMU,CHAR)
C  is same as TEXT_LATEX, but X,Y (between 0 and 1)
C  are coordinates relative to the box.
C  CALL THICK_BORDER allows to increase the thickness of
C  the white box (normally 1. point).

C ***** LATEX TEXT AND FORMULAS WITH MORE THAN 80 CHARACTERS: *******
C  use one of the following for the first line ...
        CALL BEGIN_TEXT_LATEX(X,Y,ALAM,AMU,CHAR)
        CALL BEGIN_TEXT_LATEX_W(X,Y,ALAM,AMU,CHAR)
        CALL BEGIN_TEXT_RELAD_LATEX(X,Y,ALAM,AMU,CHAR)
        CALL BEGIN_TEXT_RELAD_LATEX_W(X,Y,ALAM,AMU,CHAR)
C  (signification as above), then use
        CALL CONTINUE_TEXT_LATEX(CHAR)
C  for continuation lines, and finally
        CALL END_TEXT_LATEX(CHAR)
C  for the last line of the formula.

C ********** SUBROUTINE TEXT ***********
        CALL TEXT(X,Y,CHAR)
C -----writes text "CHAR" starting at position X,Y in ps-fonts.
C  special characters: $r ... roman font, $i ... italic, 
C  $s ... symbolic, ^ ... exposants, _ ... subscript,
C  ~ ... back to normal.

C ************ SUBROUTINE TEXT28 ****************
        CALL TEXT28(X,Y)
C ----- reads text from file 28 and writes at position X,Y;
C  enables to write text and numbers created by the program,
C  for example results of a computation. Write them to file 28,
C  in a format as required by TEXT for CHAR, then call TEXT28.

C ********** SUBROUTINE TEXT_RELAD ***********
        CALL TEXT_RELAD(X,Y,CHAR)
C  same as TEXT, but X,Y (between 0 and 1)
C  are coordinates relative to the box.

C ********** SUBROUTINE TEXT_W, TEXT_WW ***********
        CALL TEXT_W(X,Y,CHAR)
        CALL TEXT_WW(X,Y,CHAR)
C  same as TEXT, but with text in white box.

C ************ OTHER POSSIBILITIES ****************
        CALL TEXT28_RELAD(X,Y)
        CALL TEXT28_APPEND
        CALL TEXT28_W(X,Y)
        CALL TEXT28_RELAD_W(X,Y)
        CALL TEXT28_APPEND_W

c
C ************ SUBROUTINE ACCOLADE_X,ACCOLADE_Y ****************
      CALL ACCOLADE_X(YOFF,YFERM,X1,X2)
      CALL ACCOLADE_Y(XOFF,XFERM,Y1,Y2)
C  to draw big braces.


C ************  BITMAP PACKAGE ************
      CALL BITMAP_PREPARE
      CALL BITMAP_POINT(X,Y,ITHICK)
      CALL BITMAP_POINT_CLR(X,Y,ITHICK)
      CALL BITMAP_PIX(IPX,IPY)
      CALL BITMAP_PIX_CLR(IPX,IPY)
      CALL BITMAP_SEND
C  for handling individual dots of the 600dpi printer,
C  for example for drawing millions of dots.
C  BITMAP_PREPARE cleans the memory,
C  BITMAP_PIX(IPX,IPY) adds a singular dot at pixel-number ipx,ipy
C  BITMAP_PIX_CLR(IPX,IPY) clears the same dot
C  BITMAP_POINT(X,Y,ITHICK) adds a spot of thickness ITHICK at
C  position X,Y.
C  BITMAP_POINT_CLR clears the spot.
C  BITMAP_SEND sends then the whole picture to the printer.
C  The routines
        INTEGER FUNCTION PIXEL_X(X)
        REAL FUNCTION VAL_PIXEL_X(IPX)
        INTEGER FUNCTION PIXEL_Y(Y)
        REAL FUNCTION VAL_PIXEL_Y(IPY)
C  give the relations between real values x,y and
C  integer pixel numbers of 600dpi plotting routines.
