Next: graph_ticks Up: MacAnova Help File Previous: graph_files   Contents

graph_keys

Usage:
List of keywords which can be used on some or all graphing commands or
to name a component of the value of graphics keyword 'keys'.
 Keyword               Value
 add                   T or F
 borders               "all", "none" or combination of "B","L","T","R"
 dumb                  T or F
 epsf                  T or F
 file                  CHARACTER scalar file name
 height                Integer >= 12
 impulse               T or F
 keep                  F or T
 keys                  structure with graphics keyword component names
 landscape             T or F
 lines                 T or F
 linetype              Integer between -99 and 99
 logx                  T or F
 logy                  T or F
 new                   T or F
 notes                 CHARACTER vector
 pause                 T or F
 ps                    F or T
 screendump            CHARACTER scalar file name
 show                  F or T
 silent                F or T
 strings               CHARACTER scalar or vector
 symbols               CHARACTER or integer scalar, vector or matrix
 thickness             REAL scalar between .1 and 10
 ticks                 "all", "none" or combination of "B","L","T","R"
 title                 CHARACTER scalar (<= 75 characters)
 width                 Integer >= 30
 window                Integer between 0 and 8
 x                     REAL vector or NULL (only in 'keys')
 xaxis                 F or T
 xlab                  CHARACTER scalar (<= 50 characters)
 xmax                  REAL scalar or ?
 xmin                  REAL scalar or ?
 xticklabs             CHARACTER vector
 xticklen:             REAL scalar >= -1
 xticks                REAL vector, ? or NULL
 y                     REAL vector or matrix or NULL (only in 'keys')
 yaxis                 F or T
 ylab                  CHARACTER scalar (<= 20 characters)
 ymax                  REAL scalar or ?
 ymin                  REAL scalar or ?
 yticklabs             CHARACTER vector
 yticklen              REAL scalar >= -1
 yticks                REAL vector, ? or NULL

Topic 'graphs' has general information on making graphs.



Keywords: plotting
Here is a summary of the optional keyword phrase arguments recognized by
most plotting commands.  See also topics 'graphs', 'graph_files',
'keywords', 'graph_assign'.  You can get a list of all the keywords with
their permissible values by typing 'usage(graph_keys)'.

After the list of keywords there are specific descriptions of the use of
'add:T', 'keys:Str' and GRAPHWINDOWS[i] <- structure(...) with structure
components named using graphics keywords.

                      Catalog of graphics keywords
     Keyword Phrase                   Description
 x:xdata *                            xdata a REAL vector specifying
                                      data for x-axis or NULL
 y:ydata *                            ydata a REAL vector or matrix
                                      specifying data for y-axis or NULL
 symbols:symVar                       symVar a CHARACTER or integer
                                      scalar, vector or matrix
                                      specifying plotting symbols;
                                      symVar = "###" means use row or
                                      column number as plotting symbol
 strings:charVar                      charVar a CHARACTER scalar or
                                      vector specifying labelling
                                      information to be plotted at
                                      positions specified by x and y.
 keys:Str                             Str a structure with names
                                      matching other graphics keywords;
                                      see below.
 add:T                                Combine the information in the
                                      current plotting command with
                                      information in LASTPLOT (or a
                                      GRAPH variable argument) to create
                                      a new graph; see below.
 title:"Plot title of your choice"    (up to 75 characters)
 xlab:"X-axis label"                  (up to 50 characters)
 ylab:"Y-axis label"                  (up to 20 characters)
 xmin:xMinVal or xmin:?               Minimum and maximum values for
 xmax:xMaxVal or xmax:?               x-axis and y-axis.  Value ?
 ymin:yMinVal or ymin:?               means compute from new data and
 ymax:yMaxVal or ymax:?               any data in graph being modified.
 logx:T                               Use log scale for x-axis
 logy:T                               Use log scale for y-axis
 xaxis:F                              Do not draw x axis (line y = 0).
 yaxis:F                              Do not draw y axis (line x = 0).
 borders:Word                         Controls which sides of the graph
                                      borders will be drawn.  Word can
                                      be "all", "none", "", or a
                                      combination of one or more of "B",
                                      "b", "L", "l", "T", "t", "R", "r".
                                      See topic 'graph_border'.
 ticks:Word                           Controls which sides of the
                                      graph will have tick marks.  Word
                                      has same form as for 'borders'.
                                      See topic 'graph_ticks'.
 xticks:RealVec                       Locations for x- or y-axis tick
 yticks:RealVec                       marks and labels. xticks:? and
                                      yticks:? mean compute from data.
                                      xticks:NULL and yticks:NULL mean
                                      no tick marks or labels.  See
                                      topic 'graph_ticks'
 xticklabs:CharVec                    Labels for x-axis or y-axis tick
 yticklabs:CharVec                    locations.  Permissible only with
                                      custom tick positions and when
                                      length(CharVec) = number of ticks.
                                      See topic 'graph_ticks'
 xticklen:length                      Length of x- or y-axis ticks.
 yticklen:length                      Value length >= -1.  length < 0
                                      means outside frame; length > 2
                                      means full gridline.  Defaults are
                                      .5
 lines:T                              On all plotting commands except
                                      boxplot(), stringplot() and
                                      addstrings(), connect successive
                                      points with lines.
 lines:F                              Suppress drawing lines on
                                      lineplot() and addlines().
 linetype:n                           On lineplot() and other commands
                                      with lines:T sets the line type to
                                      n, default is 1 (solid line).  n
                                      must be an integer -100 < n < 100.
                                      n < 0 is the same as abs(n) except
                                      no warning is printed when lines
                                      are not being drawn; n = 0 is the
                                      same as n = -1
 thickness:W                          On lineplot() and other commands
                                      with lines:T sets the line
                                      thickness to W times normal
                                      thickness, default = 1.  W must be
                                      between .1 and 10.  Has no effect
                                      when not feasible as with dumb:T.
 impulse:T                            On all plotting commands except
                                      boxplot(), stringplot() and
                                      addstrings(), draw line from
                                      x-axis (y=0 line) to points.
 show:F                               Do not display plot, only save as
                                      LASTPLOT but not in GRAPHWINDOWS
 keep:F                               Do not save plot as LASTPLOT or in
                                      GRAPHWINDOWS; only display.  The
                                      corresponding component of
                                      GRAPHWINDOWS is cleared unless
                                      show:F is an argument.
 dumb:T                               Make low resolution plot using
                                      printable characters only,
                                      suitable for printing on a line
                                      printer.  Default is taken from
                                      option 'dumbplot'; F means high
                                      resolution.
 height:n                             Number of lines to be used in
                                      "dumb" plot; n >= 12 is required;
                                      ignored without dumb:T.
 width:n                              Width in character positions to be
                                      used in "dumb" plot; n >= 30 is
                                      required; ignored without dumb:T.
 window:n                             Draw plot in window n (1 <= n <=
                                      8).  (versions with windows only)
                                      If n = 0, use window most recently
                                      used.
 pause:T (versions with windows)      Forces (T) or suppresses (F) a
 pause:F (other versions)             pause after the graph is drawn.
 file:FileName                        Write PostScript to file Filename
 new:T                                Clear file FileName before writing
 landscape:T                          PostScript plot will be rotated so
                                      as to fill 8.5" by 11" page.
 ps:F                                 Suppresses PostScript when
                                      writing a plot to a file.  On
                                      Unix/Linux, Tektronix plotting
                                      commands are written.  On a
                                      Macintosh, a PICT file is written.
                                      On other systems, a 'dumb' plot is
                                      written.
 epsf:T (Macintosh only)              Produces an encapsulated
                                      PostScript file.  Legal only with
                                      file:fileName.
 silent:T                             Suppress warning messages
 screendump:FileName                  Save a copy of screen in file
 (Macintosh and DOS extended memory   FileName in a form other
 versions only)                       applications may be able to
                                      import.
 notes:charVec                        Adds notes to GRAPH symbol
                                      LASTPLOT ; charVec must be a
                                      CHARACTER vector or scalar.  See
                                      topic 'notes'.
* 'x' and 'y' have no special meaning as keywords but have meaning as
component names of the value of keyword 'keys' when it is an argument.
See below.

                     Use of keyword phrase 'add:T'
When keyword phrase 'add:T' is an argument to plot(), chplot(),
lineplot() or stringplot(), it makes them behave like addpoints(),
addchars(), addlines() and addstrings(), respectively.  'add' may not be
used without new data, so it is illegal with showplot().  Conversely,
use of 'add:F' on addpoints(), addchars(), addlines() or addstrings()
makes them behave like plot(), chplot(), lineplot() or stringplot().

                   Use of keyword phrase 'keys:Str'
The various graphics keyword phrases are usually used as separate
arguments to plotting commands.  Instead you can specify them by
argument keys:Str, where Str is a structure with components with names
matching graphics keywords.  With this usage, no graphics keyword
phrases except keys:Str can be arguments.  In addition to the regular
graphics keyword names such as 'xlab' and 'ticks', you can use names 'x'
and 'y' to specify components of Str which provide data to plot.

This is probably best illustrated by example.  The following lines are
equivalent.

  Cmd> plot(time,d,xmin:0,ymin:0,xlab:"Time",ylab:"Distance")

  Cmd> plot(time,d,keys:structure(xmin:0,ymin:0,xlab:"Time",\
       ylab:"Distance"))

  Cmd> plot(keys:structure(x:time,y:d,xmin:0,ymin:0,xlab:"Time",\
       ylab:"Distance"))

The following is illegal because it mixes use of 'keys' with graphics
keywords 'xlab' and 'ylab' outside the structure.

  Cmd> plot(time,d,keys:structure(xmin:0,ymin:0), xlab:"Time",\
       ylab:"Distance") # xlab & ylab are not in the structure

         Use of keywords with GRAPHWINDOWS[I] <- structure(...)

Many of the graphics keywords can be used to define the components of a
structure being assigned to GRAPHWINDOWS[I].  For example,

  Cmd> GRAPHWINDOWS[3] <- structure(x:time,y:d,lines:T,xlab:"Time",\
       ylab:"Distance")

has the same effect as

  Cmd> lineplot(time,d,window:3,xlab:"Time", ylab:"Distance").

The structure being assigned to GRAPHWINDOWS[I] must not have components
named 'file', 'new', 'landscape', 'ps', 'epsf' or 'screendump'.  If
there are components named 'keep' and/or 'show' they must have value
True.  In windowed versions, the structure should not have components
'dumb', 'height' or 'width'.  If there is a component named 'windows',
its value must be the same as I.  If either component 'x' or 'y' is
NULL, GRAPHWINDOWS[I] is unchanged.

See topics 'GRAPHWINDOWS' and 'graph_assign' for more details


Gary Oehlert 2003-01-15