6.3 Colours

This paragraph describes  routines  that modify  colours.  A
colour value in DISLIN may be an entry of the current colour
table, or an explicit RGB value. When specifying an explicit
RGB value,  the colour value  must have  the following hexa-
decimal form:  01bbggrr.  The  low-order  byte  contains the
intensity of red, the second byte the intensity of green and
the  third byte the intensity of blue.  The high-order  byte
must have the value 1. The function INTRGB creates an expli-
cit RGB value from RGB coordinates. If the output device can
only display 256 colours and an explicit RGB value is given, 
the nearest entry  in the current  colour table that matches
the  RGB  coordinates  will  be used.  Some routines  define 
colours  also  by name such as COLOR, or by RGB  coordinates
such as SETRGB. 

6.3.1 Changing the Foreground Colour

                         C O L O R

COLOR defines the colours used for plotting text and lines.

The call is:  CALL COLOR (CNAME)               level 1, 2, 3

CNAME         is a character string that can have the values
              'BLACK',  'RED',   'GREEN',  'BLUE',   'CYAN',
              'YELLOW', 'ORANGE', 'MAGENTA', 'WHITE', 'FORE'
              'BACK', 'GRAY' and 'HALF'.  The keyword 'FORE'
              resets the colour to the default value,  while
              the  keyword  'BACK'  sets the  colour  to the
              background color. 'HALF' sets a new foreground
              colour with the half intensity  of the current
              foreground colour.

Note:         The values  'BLACK' and 'WHITE' define not ab-
              solute colours. If the output format is in re-
              verse mode,  'BLACK' is interpreted as 'WHITE'
              and 'WHITE' is interpreted as 'BLACK'.  If you
              want to use true black and true white, you can
              use the routine SETRGB (0., 0., 0.) and SETRGB
              (1., 1., 1.). 

                         S E T C L R

The  routine  SETCLR  sets  the foreground colour  where the
colour can be specified as a colour table entry or as an ex-
plicit RGB value.

The call is:  CALL SETCLR (NCOL)               level 1, 2, 3

NCOL          is a colour value.
                                Default: NCOL = 255 (White).

                         S E T R G B

The routine  SETRGB defines the  foreground colour specified
in RGB coordinates. 
 
The call is:  CALL SETRGB (XR, XG, XB)         level 1, 2, 3

XR, XG, XB    are the  RGB  coordinates  of a colour  in the 
              range 0 to 1. If the output device cannot dis-
              play true colours, SETRGB sets the nearest en-
              try in the colour table  that matches  the RGB
              coordinates. 

6.3.2 Modifying Colour Tables

                         S E T V L T

SETVLT selects a colour table.

The call is:  CALL SETVLT (CVLT)               level 1, 2, 3
CVLT          is a character string  that defines the colour
              table.
  = 'SMALL'   defines  a  small  colour table with the 8 co-
              lours:   1 = BLACK,    2 = RED,    3 =  GREEN, 
              4 = BLUE,  5 = YELLOW, 6 = ORANGE, 7 =  CYAN
              and 8 = MAGENTA.
  = 'VGA'     defines the  16 standard colours of a VGA gra-
              phics card.
  = 'RAIN'    defines  256  colours  arranged  in a  rainbow
              where 0 means black and 255 means white.
  = 'SPEC'    defines  256  colours  arranged  in a  rainbow
              where 0 means black and 255 means white.  This
              colour  table  uses  more  violet colours than
              'RAIN'.
  = 'GREY'    defines  256 grey scale colours  where 0 means
              black and 255 is white.
  = 'RRAIN'   is the reverse colour table of 'RAIN'.
  = 'RSPEC'   is the reverse colour table of 'SPEC'.
  = 'RGREY'   is the reverse colour table of 'GREY'.
  = 'TEMP'    defines a temperature colour table.
              The default colour table is  'RAIN'.

                          M Y V L T

The routine MYVLT changes the current colour table.

The call is:  CALL MYVLT (XR, XG, XB, N)    level 0, 1, 2, 3

XR, XG, XB    are arrays  containing  RGB coordinates in the
              range 0 to 1.
N             is the number of colour entries.

                         S E T I N D

The routine  SETIND  allows  the user  to change the current
colour table.

The call is:  CALL SETIND (INDEX, XR, XG, XB)  level 1, 2, 3

INDEX         is an index between  0 and 255.
XR, XG, XB    are the  RGB  coordinates  of a  colour in the
              range 0 to 1.

                         V L T F I L

The routine VLTFIL saves the current colour table to a file,
or loads a colour table from a file.

The call is:  CALL VLTFIL (CFIL, COPT)         level 1, 2, 3

CFIL          is a character string containing a filename. 
              Colour entries  are stored  in the file as RGB 
              coordinates in the range 0 to 1.
COPT          is a character string that can have the values 
              'SAVE' and 'LOAD'. 
   
6.3.3 Utility Routines for Colours

                         I N T R G B

The function  INTRGB  creates  an explicit colour value from 
RGB coordinates.

The call is:  N = INTRGB (XR, XG, XB)       level 0, 1, 2, 3

XR, XG, XB    are the  RGB coordinates  of a colour  in  the 
              range 0 to 1.
N             is the returned colour value.

                         I N D R G B

The function  INDRGB returns the nearest entry in the colour 
table that matches given RGB coordinates.
 
The call is:  N = INDRGB (XR, XG, XB)          level 1, 2, 3

XR, XG, XB    are the  RGB coordinates  of a colour  in  the 
              range 0 to 1.
N             is the returned colour index.


Sometimes,  it is easier to specify colours as HSV coordina-
tes where H is the hue, S the saturation and  V the value of
a colour.  The following routines  convert coordinates  from
the HSV to the RGB model and vice versa.

                         H S V R G B

The routine HSVRGB converts HSV coordinates to RGB coordina-
tes.

The call is:  CALL HSVRGB (XH, XS, XV, XR, XG, XB)
                                               level 1, 2, 3

XH, XS, XV    are the hue, saturation and value of a colour.
              XH  must be  in the range  0  to  360  degrees
              while  XS and XV can have values between 0 and
              1. In the HSV model, colours lie in a spectral
              order on a six-sided pyramid where red corres-
              ponds to the angle 0, green to 120 and blue to
              240 degrees.
XR, XG, XB    are the  RGB  coordinates  in the range 0 to 1
              calculated by HSVRGB.

                         R G B H S V

The routine RGBHSV converts RGB coordinates to HSV coordina-
tes.

The call is:  CALL RGBHSV (XR, XG, XB, XH, XS, XV)
                                               level 1, 2, 3

6.4 Text and Numbers

                        H E I G H T

HEIGHT defines the character height.

The call is:  CALL HEIGHT (NHCHAR)             level 1, 2, 3
NHCHAR        is the character height in plot coordinates.
                                        Default: NHCHAR = 36

                         A N G L E

This routine modifies the direction of text plotted with the
routines MESSAG, NUMBER, RLMESS and RLNUMB.

The call is:  CALL ANGLE (NDEG)                level 1, 2, 3

NDEG          is an angle measured in degrees and a counter-
              clockwise direction.
                                           Default: NDEG = 0

                         T X T J U S

The routine  TXTJUS  defines  the alignment  of text plotted
with the routines MESSAG and NUMBER.

The call is:  CALL TXTJUS (CJUS)               level 1, 2, 3

CJUS          is a character string that can have the values
              'LEFT',  'RIGHT'  and  'CENT'  for  horizontal 
              alignment and 'TOP', 'BOTTOM' and 'MIDDLE' for
              vertical alignment.
                              Default: CJUS = 'LEFT', 'TOP'.

                         T X T B G D

TXTBGD defines a background colour for text and numbers.

The call is:  CALL TXTBGD (NCLR)               level 1, 2, 3

NCLR          is a colour number. The default value -1 means
              that no background is plotted. The margin bet-
              ween background border and text is  (LINESP-1)
              * NHCHAR, where LINESP is the value in LINESP.
                                          Default: NCLR = -1

                         F R M E S S

FRMESS defines the thickness  of frames around  text plotted
by MESSAG.

The call is:  CALL FRMESS (NFRM)               level 1, 2, 3

NFRM          is the  thickness  of frames in plot coordina-
              tes.  If  NFRM  is negative,  frames  will  be
              thickened from the inside. If positive, frames
              will  be thickened  towards  the outside.  The
              margin between frames and text is (LINESP - 1)
              * NHCHAR, where LINESP is the value in LINESP.
                                           Default: NFRM = 0

                         N U M F M T

NUMFMT modifies  the format of numbers plotted by NUMBER and
RLNUMB.

The call is:  CALL  NUMFMT (COPT)              level 1, 2, 3

COPT          is a character string defining the format.
  = 'FLOAT'   will plot numbers in floating point format.
  = 'EXP'     will  plot numbers in exponential format where
              fractions range between 1 and 10.
  = 'FEXP'    will plot  numbers  in the  format fEn where f
              ranges between 1 and 10.
  = 'LOG'     will plot numbers logarithmically with base 10
              and the corresponding exponents. The exponents
              must be passed to NUMBER and RLNUMB.
                                    Default: COPT = 'FLOAT'.

Note:         SETEXP and SETBAS alter the position  and size 
              of exponents.

                         N U M O D E

NUMODE  alters the appearance  of numbers plotted by  NUMBER
and RLNUMB.

The call is:  CALL NUMODE (CDEC, CGRP, CPOS, CFIX)
                                               level 1, 2, 3

CDEC          is a character string that defines the decimal
              notation.
  = 'POINT'   defines a point.
  = 'COMMA'   defines a comma.
CGRP          is a character string  that defines  the grou-
              ping of 3 digits.
  = 'NONE'    means no grouping.
  = 'SPACE'   defines a space as separator.
  = 'POINT'   defines a point as separator.
  = 'COMMA'   defines a comma as separator.
CPOS          is a  character string  that defines  the sign
              preceding positive numbers.
  = 'NONE'    means no preceding sign.
  = 'SPACE'   defines a space as a preceding sign.
  = 'PLUS'    defines a plus as a preceding sign.
CFIX          is a  character  string  specifying  character
              spacing.
  = 'NOEQUAL' is used for proportional spacing.
  = 'EQUAL'   is used for non-proportional spacing.
                 Default: ('POINT','NONE','NONE','NOEQUAL').

                         C H A S P C

CHASPC affects inter character spacing.

The call is:  CALL CHASPC (XSPC)               level 1, 2, 3

XSPC          is a real number  that contains  a multiplier.
              If XSPC < 0, the inter character spacing  will
              be reduced by XSPC * NH plot coordinates where
              NH is the current character height.  If XSPC >
              0, the spacing will be  enlarged by  XSPC * NH
              plot coordinates.
                                          Default: XSPC = 0.

                         C H A W T H

CHAWTH affects the width of characters.

The call is:  CALL CHAWTH (XWTH)               level 1, 2, 3

XWTH          is a real number between 0 and 2. If XWTH < 1,
              the character width will be reduced. If XWTH >
              1, the character width will be enlarged.
                                          Default: XWTH = 1.

                         C H A A N G

CHAANG defines an inclination angle for characters.

The call is:  CALL CHAANG (ANGLE)              level 1, 2, 3
ANGLE         is the  inclination angle  between  characters
              and the vertical direction in degrees  (-60 <=
              ANGLE <= 60).
                                         Default: ANGLE = 0.

                         F I X S P C

All fonts in  DISLIN except for the default font are propor-
tional. After a call to FIXSPC  the characters  of a propor-
tional  font will  also be plotted with a constant character
width.

The call is:  CALL FIXSPC (XFAC)               level 1, 2, 3

XFAC          is a real number containing a  scaling factor.
              Characters  will be centred  in a box of width
              XFAC * XMAX  where XMAX is the largest charac-
              ter width of the current font.

6.5 Fonts

The  following  routines  define  character sets  of varying
style and plot velocity.  All fonts  except for  the default
font  DISALF  are proportional.  Each font provides 6 alpha-
bets.


The calls are:   CALL DISALF   - default font
                 CALL SIMPLX   - single stroke font
                 CALL COMPLX   - complex font
                 CALL DUPLX    - double stroke font
                 CALL TRIPLX   - triple stroke font
                 CALL GOTHIC   - gothic font
                 CALL SERIF    - complex shaded font
                 CALL HELVE    - shaded font
                 CALL HELVES   - shaded font with small cha-
                                 racters

Note:         If one  of the shaded fonts  SERIF,  HELVE  or
              HELVES is used,  only the outlines of  charac-
              ters  are plotted  to minimize  plotting time.
              With the statement CALL SHDCHA characters will
              be shaded.

                         P S F O N T

PSFONT defines a PostScript font.

The call is:  CALL PSFONT (CFONT)              level 1, 2, 3

CFONT         is a  character  string  containing  the font.
              Standard font names in PostScript are:

       Times-Roman                   Courier
       Times-Bold                    Courier-Bold
       Times-Italic                  Courier-Oblique
       Times-BoldItalic              Courier-BoldOblique
       Helvetica                     AvantGarde-Book
       Helvetica-Bold                AvantGarde-Demi
       Helvetica-Oblique             AvantGarde-BookOblique
       Helvetica-BoldOblique         AvantGarde-DemiOblique
       Helvetica-Narrow              Bookman-Light
       Helvetica-Narrow-Bold         Bookman-LightItalic
       Helvetica-Narrow-Oblique      Bookman-Demi
       Helvetica-Narrow-BoldOblique  Bookman-DemiItalic
       NewCenturySchlbk-Roman        Palatino-Roman
       NewCenturySchlbk-Italic       Palatino-Italic
       NewCenturySchlbk-Bold         Palatino-Bold
       NewCenturySchlbk-BoldItalic   Palatino-BoldItalic
       ZapfChancery-MediumItalic     Symbol
       ZapfDingbats

Notes:     -  The file format  must be set to  'PS',  'EPS',  
              'PDF' or 'SVG'  with the routine  METAFL.  For
              SVG files,  the Times,  Helvetica and  Courier
              fonts can be used. 
           -  Font names cannot be shortened.  Some printers
              provide  additional  non-standard fonts. These
              fonts should be specified exactly in upper and
              lower  characters as they are described in the
              printer  manuals.  PostScript  suppresses  any
              graphics  if there is  a syntax  error  in the
              font name.  Standard font names  are not case-
              sensitive.
           -  A call  to a  DISLIN  font  resets  PostScript
              fonts.
           -  The  character  coding  defined  with   CHACOD 
              should be 'STANDARD' or  'ISO1' for PostScript
              fonts. Otherwise, the DISLIN font  'COMPLX' is
              used.  

                         W I N F N T

WINFNT defines a TrueType font  for screen output on Windows
displays.

The call is:  CALL WINFNT (CFONT)              level 1, 2, 3

CFONT         is a  character  string  containing  the font.
              The following  fonts can  normally be  used on
              a Windows operating system:

              Courier New
              Courier New Bold
              Courier New Italic
              Courier New Bold Italic
              Times New Roman
              Times New Roman Bold
              Times New Roman Italic
              Times New Roman Bold Italic
              Arial
              Arial Bold
              Arial Italic
              Arial Bold Italic

Note:         The coding of a Windows font should correspond
              to the character coding defined with CHACOD. 
              For example, if the character coding in CHACOD
              is set to 'STANDARD' or 'ISO1', an ISO-Latin-1
              should be used. If the character coding is set
              to 'UTF8', a Unicode font should be loaded.  

                         X 1 1 F N T

X11FNT  defines an  X11 font  for screen output on  X11 dis-
plays. 

The call is:  CALL X11FNT (CFONT, COPT)        level 1, 2, 3

CFONT         is a  character  string  containing  the first
              part of an X11 font.
COPT          is a character string containing the last part
              of an  X11 font. IF COPT = 'STANDARD', the va-
              lue '-*-*-*-*-iso8859-1'  is used for the last
              part of an X11 font.

Notes:      - CFONT  must  begin  and end with the separator 
              '-'  and must contain the first five fields of
              an X11 font.  DISLIN adds  then the point size
              and a transformation matrix to the font. 
              IF COPT has not the value 'STANDARD',  it must
              begin with  the character '-'  and contain the
              last 6 fields of an X11 font.
            - The coding of the  X11  font should correspond
              to the coding defined with CHACOD (see WINFNT).

Here are some examples for the  contents  of CFONT:

                  -Adobe-Times-Medium-R-Normal-
                  -Adobe-Times-Bold-R-Normal-
                  -Adobe-Times-Bold-I-Normal-
                  -Adobe-Helvetica-Bold-R-Normal-
                  -Adobe-Courier-Medium-R-Normal-

                         B M P F N T

DISLIN contains some bitmap fonts  that can be set  with the
routine BMPFNT.  Bitmap fonts are allowed  for screen output
and for a bitmap file format.  They can be used  to increase
the quality of directly created raster formats  such as  PNG
and TIFF.

The call is:  CALL BMPFNT (CFONT)              level 1, 2, 3

CFONT         is a character string that can have the values
              'COMPLX',  'SIMPLX'  and  'HELVE'.  The DISLIN
              bitmap  fonts  contain  characters  for 'STAN-
              DARD', 'ISO1', 'ISO2' and 'ISO3' coding.

                         T T F O N T

TTFONT loads a Windows TrueType font.  The characters of the
font can be used for all Dislin output devices.  By default,
only the outlines of the  characters are plottted. After the
statement CALL SHDCHA characters will be shaded.

The call is:  CALL TTFONT (CFILE)              level 1, 2, 3

CFILE         is a character string that contains  the file-
              name of a TrueType font.  If the filename does
              not contain a full directory path, the file is
              searched in the current directory, in the Win-
              dows fonts and in the Dislin fonts directory. 
              For Linux, the  font  is  also searched in the
              directory '/usr/X11R6/lib/X11/fonts/truetype/'

Note:         The intention of this routine is to  make Uni-
              code characters available for all  Dislin out-
              put formats.

                         H W F O N T

The routine HWFONT sets a standard hardware font if hardware
fonts are supported by the current file format. For example,
if the file format is PostScript, the font 'Times Roman'  is
used, if the file format is 'CONS' or 'XWIN', 'Times New Ro-
man' is used for Windows  and  '-*-Times-Bold-R-Normal-'  is
used for X11. If no hardware fonts are supported,  COMPLX is
used.

The call is:  CALL HWFONT                      level 1, 2, 3

                         C H A C O D

The routine CHACOD defines the coding of characters.  

The call is:  CALL CHACOD (COPT)               level 1, 2, 3

COPT          is a character string that can have the values
              'STANDARD',  'ISO1',  'ISO2',  'ISO3', 'ISO5',
              'ISO7',  'KOI8' and 'UTF8'. The keyword 'STAN-
              DARD' means the DISLIN coding of characters as
              displayed in the figures  6.4 to  6.10  of the
              DISLIN manual. 
              'ISO5' and 'KOI8' are encodings  for  Cyrillic
              characters  while 'ISO7' is a coding for Greek
              characters.  'UTF8'  is a  coding for  Unicode
              characters.  If COPT  is not  'STANDARD',  the 
              coding is mapped to the available DISLIN char-
              acters.  
                                        Default: 'STANDARD'.

                         B A S A L F

BASALF defines the base alphabet.

The call is:  CALL BASALF (CALPH)              level 1, 2, 3

CALPH         is a character string that can have the values
              'STANDARD', 'ITALIC', 'GREEK', 'SCRIPT', 'RUS-
              SIAN' and 'MATHEMATIC'. These alphabets can be
              used with all fonts.
                                        Default: 'STANDARD'.

                         S M X A L F

SMXALF  defines  shift characters  to shift between the base
and an alternate alphabet.

The call is:  CALL SMXALF (CALPH, C1, C2, N)   level 1, 2, 3

CALPH         is a character string  containing an alphabet.
              In addition to the names in BASALF,  CALPH can
              have the value 'INSTRUCTION'.
C1            is a character  that shifts  to the  alternate
              alphabet.
C2            is a character  that  shifts  back to the base
              alphabet.  C1 and  C2 may be identical.  After
              the  last  plotted  character  of a  character
              string,  DISLIN  automatically  shifts back to
              the base alphabet.
N             is an integer between 1 and 6.  Up to 6 alter-
              nate alphabets can be defined.

                         P S M O D E

The routine PSMODE sets PostScript options.

The call is:  CALL PSMODE (COPT)            level 0, 1, 2, 3

COPT          is a character string that can have the values
              'NONE',  'GREEK',  'ITALIC',  'BOTH', 'SINGLE'
              and 'MULTI'. The options 'GREEK', 'ITALIC' and
              'BOTH' enable Greek and Italic PostScript cha-
              racters. If they are disabled,  DISLIN  vector
              characters are used.  PSMODE must be called in
              level 1, 2 or 3 for this options.
              The option 'SINGLE' defines an old-style Post-
              Script format without  PostScript commands for
              multiple pages. PSMODE must be called in level
              0 for the options 'SINGLE' and 'MULTI'.
                                  Defaults: 'NONE', 'MULTI'.

                         E U S H F T

EUSHFT  defines a shift  character  to plot special European
characters.

The call is:  CALL EUSHFT (CNAT, CHAR)         level 1, 2, 3

CNAT          is a character string that can have the values
              'GERMAN',   'FRENCH',   'SPANISH',   'DANISH',
              'ACUTE' , 'GRAVE', 'CIRCUM' and 'TURKISH'.
CHAR          is a shift character. For example, with CNAT =
              'GERMAN', the characters A, O, U, a, o, u  and
              s placed directly  after CHAR  will be plotted
              as Ae, Oe, Ue, ae, oe, ue and ss.

Notes:     -  Shift characters can be defined multiple where
              the characters must be different.
           -  The Turkish  characters are  only supported by
              COMPLX and  by the bitmap  fonts  defined with
              BITMAP. The other European characters are also
              supported by PostScript.
           -  If the shift  characters should be  plotted in
              a text string, they must be doubled.
           -  European characters are not available  for the
              character codings 'ISO5', 'ISO7' and 'KOI8'.

6.6 Indices and Exponents

Indices and exponents can be  plotted  by using control cha-
racters  in characters strings,  or by using the  TeX syntax
described in paragraph 6.7.  There are  3 predefined control
characters in DISLIN which can be altered with the  routines
NEWMIX and SETMIX. The predefined character

     [     is used  for exponents.  The character  height is
           reduced by the scaling factor FEXP and the pen is
           moved up  FBAS * NH  plot coordinates where NH is
           the current character height.

     ]     is used for indices. The pen is moved down FBAS *
           NH  plot coordinates and the  character height is
           reduced by the scaling factor FEXP.

     $     is used to move  the pen  back to the  base-line.
           This will  automatically be done at  the end of a
           character string.

FBAS and FEXP have the default values  0.6 and 0.8,  respec-
tively, these values can be changed with the routines SETBAS
and SETEXP.

                        M I X A L F

This routine instructs DISLIN  to search for control charac-
ters in character strings.

The call is:  CALL MIXALF                      level 1, 2, 3

                         S E T B A S

SETBAS  defines the position  of indices and exponents. This
routine also affects logarithmic axis labels.

The call is:  CALL SETBAS (FBAS)               level 1, 2, 3

FBAS          is a real number used as a scaling factor. The
              pen will be moved up or down by FBAS * NH plot
              coordinates to plot exponents or indices.   NH
              is the current character height.
                                       Default:  FBAS = 0.6.

                         S E T E X P

SETEXP sets the character height of indices and exponents.

The call is:  CALL SETEXP (FEXP)               level 1, 2, 3

FEXP          is a real number used as a scaling factor. The
              character  height of indices  and exponents is
              set to  FEXP * NH where NH is the current cha-
              racter height.
                                        Default:  FEXP = 0.8

                         N E W M I X

NEWMIX  defines an alternate set  of control characters  for
plotting indices and exponents.  The default characters '[',
']' and '$' are replaced by '^', '_' and '%'.

The call is:  CALL NEWMIX                      level 1, 2, 3

                         S E T M I X

SETMIX  defines global control characters for plotting indi-
ces/exponents and TeX commands.

The call is:  CALL SETMIX (CHAR, CMIX)         level 1, 2, 3

CHAR          is a new control character.
CMIX          is a  character string  that defines the func-
              tion of the  control character.  CMIX can have
              the  values  'EXP',  'IND',  'RES',  'LEG' and 
              'TEX'  for exponents,  indices,  resetting the
              base-line, for multiple text lines in legends, 
              and for TeX commands, respectively.

Note:         The routines NEWMIX and SETMIX only modify the
              control characters. A call to MIXALF is always
              necessary to plot indices and exponents.

6.7 Instruction Alphabet

The instruction alphabet contains commands  that control pen
movements and character sizes during the plotting of charac-
ter strings.  It is provided for the representation  of com-
plicated formulas.  An alternate method for plotting of com-
plicated formulas is  described  in paragraph 6.7,  "TeX In-
structions for Mathematical Formulas".

The  instruction alphabet  can be  used  in the same  way as 
other alphabets in DISLIN. Shift characters  must be defined
with the routine  SMXALF  to switch between the base and the
instruction  alphabet.   The  commands  of  the  instruction  
alphabet  consist  of a single  character  and  an  optional 
parameter.  If the parameter is omitted, DISLIN will use de-
fault values.  A parameter  can be a real number, an integer 
or the  character  'X'  which  resets the  parameter back to 
the entry value at the beginning of the character string.
Commands of  the instruction alphabet  can only  change plot
parameters temporarily within a character string. At the end
of a  character string,  all parameters  are reset  to their
entry values.

The following table summarizes all instruction commands. The
character  r means  a real parameter and  i an integer.  The
base-line  of character  strings  is placed  directly  below
them.  Commands can be given in uppercase or  lowercase let-
ters.  Real  parameters  can  be  specified  without decimal
points while integer parameters cannot have  decimal points. 
Several commands can follow one another. Blanks between com-
mands will be ignored.

                    Instruction-Alphabet
                           
------------------------------------------------------------
| Cmd. Par.  Default            Description                |
------------------------------------------------------------
|  A   real     1.    moves the pen horizontally by r * NH |
|                     plot  coordinates  where  NH is  the |
|                     current character height.  If r < 0, |
|                     the pen  will be moved backwards.    |
|                                                          |
|  C   integer  1     moves the pen horizontally by i cha- |
|                     racter  spaces.  If i < 0,  the  pen |
|                     will be moved backwards.             |
|                                                          |
|  D   real     1.    moves the pen  down from  the  base- |
|                     line by r * NH plot coordinates.  If |
|                     r > 0,  NH  is the  entry  character |
|                     height.  If r < 0, NH is the current |
|                     character height.                    |
|                                                          |
|  E                  moves the pen up by 0.75 * character |
|                     height  and  reduces  the  character |
|                     height  by  the  scaling  factor 0.6 |
|                     (for exponents).                     |
|                                                          |
|  F   integer   1    moves the pen horizontally by i spa- |
|                     ces.  If i is  negative,  the pen is |
|                     moved backwards.                     |
|                                                          |
|  G   integer   1    moves  the pen  horizontally  to the |
|                     tab position with the index i, where |
|                      1 <= i <= 20.                       |
|                                                          |
|  H   real      0.6  sets the character height to r * NH. |
|                     If r > 0, NH is the entry  character |
|                     height. If r < 0,  NH is the current |
|                     character height.                    |
|                                                          |
|  I                  moves the pen down by 0.35 * charac- |
|                     ter  height  and multiplies the cha- |
|                     racter height by 0.6 (for indices).  |
|                                                          |
|  J   integer   1    underscores twice from the tab posi- |
|                     tion i to the current pen position.  |
|                                                          |
|  K   real      0.8  is used to plot characters with con- |
|                     stant  widths.  Characters  will  be |
|                     centred  in a  box  with  the  width |
|                     r * W where W is the largest charac- |
|                     ter length in the current font.  The |
|                     global routine is FIXSPC.            |
|                                                          |
|  L   integer   1    underscores from the  tab position i |
|                     to the current pen position.         |
|                                                          |
|  M   integer   1    defines the base alphabet.           |
|                     (1 = STAND.,  2 = GREEK,  3 = MATH., |
|                     4 = ITAL., 5 = SCRIPT, 6 = RUSSIAN). |
------------------------------------------------------------


------------------------------------------------------------
| Cmd. Par.  Default            Description                |
------------------------------------------------------------
|  N   integer   1    sets a  colour  i,  where  0 <= i <= |
|                     255. The global routine is SETCLR.   |
|                                                          |
|  O   real      0.   moves the  base-line  vertically  by |
|                     r * character height.  If  r < 0 the |
|                     base-line is moved down.             |
|                                                          |
|  P   integer   1    defines a  horizontal  tab  position |
|                     with the index i  at the current pen |
|                     position, where 1 <= i <= 20.        |
|                     All tab positions are initialized to |
|                     the beginning of the string.         |
|                                                          |
|  R                  resets the  character height and the |
|                     base-line to their entry values.     |
|                                                          |
|  S   integer   0    plots a  symbol  with  the number i, |
|                     where 0 <= i <= 21.                  |
|                                                          |
|  T   integer   0    moves the pen  horizontally from the |
|                     beginning  of the  string  by i plot |
|                     coordinates.                         |
|                                                          |
|  U   real      1.   moves the pen up  from the base-line |
|                     by  r * NH  plot coordinates. If r > |
|                     0, NH is the entry character height. |
|                     If r < 0,  NH is the current charac- |
|                     ter height.                          |
|                                                          |
|  V   integer   1    plots a horizontal line from the tab |
|                     position i to  the current pen posi- |
|                     tion.  The line is moved up from the |
|                     base-line  by 0.5 * character height |
|                     plot coordinates.                    |
|                                                          |
|  W   real      1.   affects the width of characters. The |
|                     global routine is CHAWTH.            |
|                                                          |
|  Y   real      0.   affects  the  character spacing. The |
|                     global routine is CHASPC.            |
|                                                          |
|  Z   real      0.   defines  an  inclination  angle  for | 
|                     characters,  where  -60 <= r <= 60.  |
|                     The global routine is CHAANG.        |
------------------------------------------------------------


6.8 TeX Instructions for Mathematical Formulas

6.8.1 Introduction

This paragraph presents  an alternate method  to the  DISLIN 
instruction alphabet for plotting mathematical formulas. The 
text formatting  language  TeX  has a  very easy  method for 
describing  mathematical  formulas.  Since  this  method  is 
well-known by many scientists,  an emulation  mode  for  TeX
instructions is added to DISLIN with version 7.4.

TeX instructions can be enabled in DISLIN with the statement 
CALL TEXMOD ('ON').  If TeX mode is enabled, mixed alphabets
defined with SMXALF  and the control characters  for indices
and exponents described in paragraph 6.5 will be ignored.

Mathematical formulas in TeX mode are produced in  DISLIN by
some special descriptive text.  This means that  DISLIN must
be informed that the following text is to be  interpreted as
a mathematical formula.  The character $ in a  text switches
from text to math mode,  and from math  to text mode. There-
fore,  mathematical formulas  must be enclosed  in a pair of
dollar signs.

Numbers that  appear  within  formulas are called constants,
whereas simple  variables are represented by single letters.
The universal practice in mathematical typesetting is to put
constants in Roman typeface and variables in italics. DISLIN
uses this  rule by  default  in math mode.  The rule  can be 
modified with the routine TEXOPT. Blanks are totally ignored
in math mode and spaces are included automatically by DISLIN
between constants, variables and operators.

The characters  $, {, } and \ have a special meaning  in TeX
mode  and therefore  cannot act as printable characters.  To
include them in normal text,  the commands \$, \{, \} and \\
must be used. Additional, the characters _ and ^ have a spe-
cial  meaning  in math mode  and can be handled  in the same 
way.

6.8.2 Enabling TeX Mode and TeX Options

                         T E X M O D

The routine TEXMOD can be used to enable TeX mode in DISLIN. 
In TeX mode, all character strings passed to DISLIN routines
can contain  TeX instructions for plotting mathematical for-
mulas.
 
The call is:  CALL TEXMOD (CMODE)              level 1, 2, 3 

CMODE         is a character string that can have the values
              'ON' and 'OFF'.  CMODE = 'ON' enables TeX mode
              and CMODE = 'OFF' disables TeX mode.
                                     Default: CMODE = 'OFF'.

                         T E X O P T

The routine TEXOPT sets some TeX options.
 
The call is:  CALL TEXOPT (COPT, CTYPE)        level 1, 2, 3 

COPT          is a character string that defines an option.
CTYPE         is a  character  string  containing a keyword.
 = 'LIMITS'   means that the  limits  for sums and integrals
              will be placed  above  and below  the  sum and
              integral signs  instead  of  following  them.
              COPT can have the values 'ON' and 'OFF'.
 = 'ITALIC'   means that for math mode variables will be put
              in italics. COPT can also have the values 'ON'
              and 'OFF'.
 = 'BRACK'    means  that  the  Dislin  Mathematical  vector
              font can be used for bracket symbols even if a
              hardware font is enabled.  COPT  can  have the
              values 'STANDARD' and 'VECTOR'.    
                                 Defaults: ('ON', 'LIMITS'),
                                           ('ON', 'ITALIC'),
                                      ('BRACK', 'STANDARD').

                         T E X V A L

The routine TEXVAL defines some scaling and  shifting values
that are used in TeX formulas.
 
The call is:  CALL TEXVAL (X, COPT)            level 1, 2, 3 

X             is a floating point  variable  containing  the
              value.
COPT          is a character string.
  = 'KEY'     defines a factor  for the  size of indices and
              exponents.
  = 'H1BR'    sets additional spaces that are plotted  after
              bracket symbols  defined with \left and before
              bracket symbols defined with \right. 
  = 'H2BR'    sets additional spaces that are plotted before
              bracket symbols  defined with \left and  after
              bracket symbols defined with \right. 
  = 'VBRACK'  defines  a  scaling  factor  for  the  size of 
              bracket symbols.
  = 'WBRACK'  defines  a scaling  factor  for  the  width of 
              bracket symbols. This option is useful for big
              brackets in PostScript fonts.
              Defaults:          (1.0, 'EXP'), (0.0, 'H1BR),
                               (0.0, 'H2BR), (1.0, 'VBRACK),
                                             (1.0, 'WBRACK).

6.8.3 Exponents and Indices
  
Exponents and indices are characters  that are either raised
or lowered  relative  to the base line of the text. The cha-
racter ^ sets  the next character as an exponent,  while the 
character _ sets it as an index.
 
When exponents  and indices occur together,  their  order is 
unimportant. If the exponent or index contains more than one
character,  the group  of  characters  must  be  enclosed in 
braces { }.

Multiple raisings  and lowerings are generated by applying ^
and _ to the exponents and indices.

Note: The commands ^ and _ are only allowed in math mode.

6.8.4 Fractions

The instruction \frac{numerator}{denominator} can be used in 
TeX math mode for plotting fractions. The numerator is plot-
ted  on top  of the  denominator  with a horizontal fraction 
line between them.  Fractions may be nested  to a depth of 8
within one another.

6.8.5 Roots 

Roots can be plotted with the syntax \sqrt[n]{arg} where the
optional part [n] can be omitted.
Roots may be nested inside one another to a depth of 8.

6.8.6 Sums and Integrals

Summation  and integral  signs  can be plotted  with the two
instructions \sum and \int.  Sums and  integrals  can posses
upper and lower limits that can be plotted with the exponent
and index instructions ^ and _.  By default,  the limits are
placed  below  and above  the summation  and integral signs. 
This can be  modified with  the routine  TEXMOD  or with the
instruction  \nolimits  following the summation and integral
signs.

6.8.7 Greek Letters

The following  Greek  letters  are available  in text and in 
math mode.  If they are used in text mode,  the first  blank
character  after the letter will be interpreted as a sepera-
tor and will be ignored.

  \alpha       \theta          o               \chi   
  \beta        \iota           \pi             \psi
  \gamma       \kappa          \rho            \omega
  \delta       \lambda         \sigma
  \epsilon     \mu             \tau
  \zeta        \nu             \upsilon
  \eta         \xi             \phi

  \Gamma       \Lambda         \Sigma          \Psi
  \Delta       \Xi             \Upsilon        \Omega
  \Theta       \Pi             \Phi

6.8.8 Mathematical Symbols

The following mathematical symbols are available in text and
in math mode.

  \pm          \cdot           \cup            \odot
  \mp          \ast            \vee            \oplus
  \times       \star           \wedge          \ominus
  \div         \cap            \setminus       \copyright

  \le, \leq    \ge, \geq       \neq            \sim 
  \subset      \supset         \cong           \mid
  \subseteq    \supseteq       \equiv          \notin
  \in          \ni             \parallel       \not=
  \approx
 
  \leqslant    \geqslant       \nless          \ngtr
  \nleq        \ngeq           \nleqslant      \ngeqslant
  \prec        \succ           \nprec          \nsucc
  \preceq      \succeq         \npreceq        \nsucceq 
  \ll          \gg             \lll            \ggg 
  \nsubseteq   \nsupseteq      \sqsubset       \sqsupset
  \sqsubseteq  \sqsupseteq     \doteq          \simeq
  \propto      \angle          \measuredangle  \circ
  \sphericalangle

  \leftarrow   \rightarrow     \Leftrightarrow \downarrow
  \Leftarrow   \Rightarrow     \uparrow

  \emptyset    \surd           \forall         \backlslash
  \nabla       \partial        \exists         \infty
  \perp

6.8.9 Alternate Alphabets

The DISLIN alphabets 'STANDARD', 'ITALIC', 'GREEK', 'SCRIPT'
and 'RUSSIAN' can be used in TeX mode with the  instructions
\rm, \it, \gr, \cal and \ru.

6.8.10 Function Names

The  standard  for mathematical  formulas is to set variable 
names  in  italics but the names of functions in Roman.  The 
following  function names will be recognized by  DISLIN  and
plotted in Roman.

  \arccos  \arcsin  \arctan  \arg    \cos    \cosh   \cot
  \coth    \csc     \dec     \dim    \exp    \hom    \ln
  \log     \sec     \sin     \sinh   \tan    \tanh

6.8.11 Accents

Accents are  available in  TeX  mode  in the  same way as in
normal DISLIN mode (see EUSHFT)

6.8.12 Lines and Symbols above and below Formulas

The commands \overline{arg}  and \underline{arg} can be used
to  draw  lines  over  and under a formula.  The  command 
\vec{arg}  draws  a  vector over a formula. 
\hat{arg}, \tilde{arg} and \dot{arg} draw a circumflex, a
tilde and a dot above arg.

All commands can be used in TeX text and math mode.

6.8.13 Horizontal Spacing

Small amounts of horizontal spacing can be added in TeX mode
with the following commands:

  \,  small space      = 3/18 of the current character size
  \:  medium space     = 4/18 of the current character size
  \;  large space      = 5/18 of the current character size
  \!  negative space   = -3/18 of the current character size

Larger amounts of horizontal  spacing can be added  with the
commands:

  \quad  extra space   = 1/1 of the current character size
  \qquad extra space   = 2/1 of the current character size

6.8.14 Selecting Character Size in TeX Mode

The commands   \tiny,  \scriptsize,  \footnotesize,  \small,  
\normalsize, \large, \Large, \LARGE, \huge and  \Huge can be
used in TeX mode for modifying the character size.  The com-
mand \normalsize is corresponding to  the current  character
size before  the  call  of  the text  plotting routine.  The 
character size  is decreased or increased by a factor of 1.2
for neighbouring character size commands.

6.8.15 Automatic Sizing of Bracket Symbols

Bracket symbols are often used in mathematic formulas,  usu-
ally in pairs that enclose part of the formula. These brack-
et symbols should have the same size as the included partial
formula. The commands \left lbrack and \right rbrack  plot a
pair of brackets with the same size as the included formula,
where lbrack can be one of the bracket symbols  '[', '(' and
'{', and rbrack one of the symbols ']', ')' and '}'. 
The commands  \left and  \right must  appear as a pair,  but
lbrack and rbrack can be different bracket symbols.  If only
a single  opening or closing bracket should be plotted,  the 
corresponding bracket symbol can have the value '.'. 

6.8.16 Manual Sizing of Bracket Symbols

The commands  \big,  \Big, \bigg and \Bigg before one of the
bracket symbols '[', '(', '{', ']', ')'  and '}' can be used
to select explicitly the size of a bracket. The command \low
before a bracket symbol plots a smaller bracket symbol.
  
6.8.17 Colours in TeX Mode

The commands  \black,  \red,  \green, \blue, \cyan, \yellow, 
\orange,  \magenta,  \white, \fore and \back set the corre-
sponding colours in TeX mode.

6.9 Curve Attributes

                         C H N C R V

CHNCRV defines attributes that will be automatically changed
by  CURVE  after a  certain  number  of calls to the routine
CURVE.

The call is:    CALL CHNCRV (CATT)             level 1, 2, 3

CATT = 'NONE'   means that CURVE changes no attributes.
     = 'COLOR'  means that colours will be changed.
     = 'LINE'   means that line styles will be changed.
     = 'BOTH'   means that  colours  and line styles will be
                changed.
                                     Default: CATT = 'NONE'.

Note:           The sequence of colours is WHITE/BLACK, RED,
                GREEN, YELLOW, BLUE, ORANGE, CYAN and MAGEN-
                TA.  The sequence  of line styles is  SOLID,
                DOT,  DASH,  CHNDSH, CHNDOT, DASHM, DOTL and
                DASHL. The symbol number  is always changed.
                It will be  incremented  by 1  starting with
                the  current symbol defined by MARKER.

The following  three routines  are useful when automatic at-
tribute setting is selected and the routine  CURVE is called
several times to  plot a single curve.

                         I N C C R V 

INCCRV  defines the number  of calls after which  CURVE will
automatically change attributes.

The call is:  CALL INCCRV (NCRV)               level 1, 2, 3

NCRV          is the number of  curves  that will be plotted
              with identical attributes.
                                           Default: NCRV = 1

                         C H N A T T 

CHNATT  is an alternative  routine to  INCCRV.  It is useful
when the number of curves plotted with  identical attributes
varies.  CHNATT defines  new attributes that will be used by
CURVE during the next call.

The call is:  CALL CHNATT                      level 1, 2, 3

Notes:     -  CHNATT changes  only attributes specified with
              CHNCRV.
           -  Attributes cannot be skipped by calling CHNATT
              several times; the order of the attribute cyc-
              les must be changed.

                         R E S A T T 

In general,  curve attributes will be repeated after 8 chan-
ges. With the routine the attributes can be reset earlier.

The call is:  CALL RESATT                      level 1, 2, 3

                         I N C M R K

INCMRK selects line or symbol mode for CURVE.

The call is:  CALL INCMRK (NMRK)               level 1, 2, 3

NMRK  = - n   means that  CURVE  plots only  symbols.  Every
              n-th point will be marked by a symbol.
      =   0   means that CURVE connects points with lines.
      =   n   means that CURVE  plots lines  and marks every
              n-th point with a symbol.
                                           Default: NMRK = 0

                         M A R K E R 

The symbols used  to plot  points  can be  selected with the
routine MARKER. The symbol number  will be  incremented by 1
after a certain  number of calls to CURVE defined by INCCRV.

The call is:  CALL MARKER (NSYM)               level 1, 2, 3

NSYM          is the  symbol  number between -1 and 21.  The
              value -1 means that no symbol is plotted.  The
              symbols are shown in appendix B.
                                           Default: NSYM = 0

                         M R K C L R 

The routine  MRKCLR  sets the colour  of  symbols plotted by 
CURVE,  so that different colours for curves and symbols can
be used. 

The call is:  CALL MRKCLR (NCLR)               level 1, 2, 3

NCLR          is a colour value.  If NCLR = -1,  the current 
              colour is selected for symbols in curves.
                                          Default: NCLR = -1

                         H S Y M B L 

HSYMBL defines the size of symbols.

The call is:  CALL HSYMBL (NHSYM)              level 1, 2, 3

NHSYM         is the size of symbols in plot coordinates.
                                         Default: NHSYM = 35

                         M Y S Y M B 

MYSYMB sets a user-defined symbol.

The call is:  CALL MYSYMB (XRAY, YRAY, N, ISYM, IFLAG)
                                               level 1, 2, 3

XRAY, YRAY    are the X- and Y-coordinates  of the symbol in
              the range -1 and 1.
N             is the number of coordinates in XRAY and YRAY.
ISYM          is a non negative number  that will be used as
              symbol number.
IFLAG         is an  Integer  that can have the values 0 and 
              1. If IFLAG = 1, the symbol will be filled.

Note:         The number of points in  MYSYMB is limited  to
              100 for Fortran 77. There is no limitation for
              the C and Fortran 90 versions of DISLIN. 

                         T H K C R V 

THKCRV defines the thickness of curves.

The call is:  CALL THKCRV (NTHK)               level 1, 2, 3

NTHK          is the thickness  of curves  in plot coordina-
              tes.
                                      Default:      NTHK = 1

                         G A P C R V
 
GAPCRV defines a data gap  used in the routine CURVE. If the
distance between two neightbouring  X coordinates is greater
than  the  gap  value,  CURVE  will not  connect  these data
points.  

The call is:  CALL GAPCRV (XGAP)               level 1, 2, 3

XGAP          is the gap value.

                         G A P S I Z
 
GAPSIZ  defines  a data  gap  used  in  the  routines CURVE, 
CURVMP and CURV3D.  This  routine is an extension to  GAPCRV
and can be used for X-, Y- and Z-coordinates.

The call is:  CALL GAPSIZ (XGAP, CAX)          level 1, 2, 3

XGAP          is the gap value.
CAX           is a character  string  that defines the axes.
              CAX  can have  the values  'X',  'Y', 'Z', any 
              combination  of these values,  or the  keyword 
              'RESET'.

                         N A N C R V

The routine NANCRV can be used to  enable the  checking  for
undefined values (NaN) in curves. NaN values will be plotted
as gaps and their count is reported in the DISLIN protocol.  
 
The call is:  CALL NANCRV (CMODE)              level 1, 2, 3 

CMODE         is a character string that can have the values
              'ON' and 'OFF'.
                                     Default: CMODE = 'OFF'.

                         P O L C R V 

POLCRV defines an interpolation method used by CURVE to con-
nect points.

The call is:  CALL POLCRV (CPOL)               level 1, 2, 3

CPOL          is a character string  containing the interpo-
              lation method.
  = 'LINEAR'  defines linear interpolation.
  = 'STEP'    defines step interpolation.
  = 'STAIRS'  defines step interpolation.
  = 'BARS'    defines bar interpolation.
  = 'FBARS'   defines filled bar interpolation.
  = 'STEM'    defines stem interpolation.
  = 'SPLINE'  defines spline interpolation.
  = 'PSPLINE' defines parametric spline interpolation.
                                   Default: CPOL = 'LINEAR'.

Notes:     -  The width of bars can be set with BARWTH.
           -  For  spline  interpolation,  the X-coordinates
              must have different values and be in ascending
              order.  There is no restriction  for a parame-
              tric spline.  The order of spline  polynomials
              and the  number of interpolated  points can be
              modified with SPLMOD.

                         S P L M O D

SPLMOD  defines the  order of polynomials  and the number of
interpolated  points  used  for  the  interpolation  methods
'SPLINE' and 'PSPLINE'.

The call is:  CALL  SPLMOD (NGRAD, NPTS)       level 1, 2, 3

NGRAD         is the  order of the  spline polynomials  (2 -
              10).  It affects the number of points accepted
              by  CURVE  which  is determined by the formula
              (2 * NGRAD + 1) * N <= 1000. For example, with
              a cubic spline, up to 142 points can be passed
              to CURVE.
NPTS          is the number of points  that will be interpo-
              lated in the range XRAY(1) to XRAY(N).
                                          Default: (3, 200).

                         B A R W T H

BARWTH sets the width of bars plotted by CURVE.

The call is:  CALL BARWTH (XWTH)               level 1, 2, 3

XWTH          defines the bar width.  If positive, the abso-
              lute value  of   XWTH * (XRAY(1) - XRAY(2)) is
              used.  If negative, the absolute value of XWTH
              is used  where XWTH is specified in plot coor-
              dinates.
                                        Default: XWTH = 0.75

Note:         If XWTH is positive and polar scaling is enab-
              led,  the absolute value of  XWTH * (YRAY(2) -
              YRAY(1)) defines the width of bars. If XWTH is
              negative for polar scaling, the absolute value
              of XWTH  is used where  XWTH must be specified
              in degrees.
    
                         N O C H E K 

The routine  NOCHEK  can be used  to suppress the listing of
points that lie outside of the axis scaling.

The call is:  CALL NOCHEK                      level 1, 2, 3

