Next: graph_border Up: MacAnova Help File Previous: GRAPHWINDOWS   Contents

graph_assign

Usage:
GRAPHWINDOWS[I] <- gVar, positive integer I, GRAPH variable gVar
GRAPHWINDOWS[I] <- structure(x:xvalues,y:yvalues [keyword phrases]),
  xvalues REAL vector, yvalues REAL vector or matrix
GRAPHWINDOWS[I] <- structure(x:xvalues,y:yvalues, symbols:ch\
  [, keyword phrases])
GRAPHWINDOWS[I] <- structure(x:xvalues,y:yvalues, lines:T\
  [, keyword phrases])
GRAPHWINDOWS[I] <- structure(x:xvalues,y:yvalues, strings:s\
  [, keyword phrases]), yvalues a REAL vector
GRAPHWINDOWS[I] <- structure(graphics keyword phrases without 'x', 'y')
GRAPHWINDOWS[I] <- NULL

Type help(GRAPHWINDOWS) for information on special variable GRAPHWINDOWS



Keywords: plotting, syntax
This topic describes the effect of GRAPHWINDOWS[I] <- var, where
GRAPHWINDOWS is a special structure variable described in topic
'GRAPHWINDOWS'.

GRAPHWINDOWS[I], component I of GRAPHWINDOWS, is either a GRAPH variable
encapsulating all the information used to draw the plot in the I-th
graphics window or NULL.  You can draw, modify or label a plot in a
graphics window by GRAPHWINDOWS[I] <- var, where var is a GRAPH
variable, a structure or NULL.  This facility supplements the use of
plotting commands such as plot(), lineplot(), chplot(), stringplot() and
showplot().

In the following, I is an integer.  Currently in the windowed versions,
I must satisfy 1 <= I <= 8 and in the non-windowed versions I = 1.

  Cmd> GRAPHWINDOWS[I] <- NULL
sets GRAPHWINDOWS[I] to NULL and renames the component "Empty_I".  If
GRAPHWINDOWS[I] contained a GRAPH variable, it is discarded.  This has
no effect on what, if anything, is displayed in graphics window I or on
the value of variable LASTPLOT if it exists.

  Cmd> GRAPHWINDOWS[I] <- graphVar
graphVar a GRAPH variable, displays the plot in graphics window I and
then makes both GRAPHWINDOWS[I] and LASTPLOT identical to graphVar.
That is, it does the same as showplot(graphVar, window:I) (simply
showplot(graphVar) in non-windowed versions).  Moreover, GRAPHWINDOWS[I]
is renamed LASTPLOT.

  Cmd> GRAPHWINDOWS[I] <- Str
where Str is a structure, can duplicate the behavior of plot(),
lineplot(..., window:I), chplot(..., window:I), stringplot(...,
window:I) and showplot(..., window:I).  Str must contain at least one
component whose name is the same as a graphics keyword (see topic
'graph_keys') and such keyword phrases determine what happens.  Any
components with graphics keyword names must have the same types of
values as the corresponding keyword.  For example, a component named
'lines' must be a LOGICAL scalar, T or F and a component 'x' must be a
REAL vector.

Str may always include components names 'x', 'y', 'xlab', 'ylab' and
'title', as well 'ticks', 'border', 'xticks', 'yticks', 'xticklen',
'yticklen', 'xticklabs' and 'yticklabs'.  When 'x' and 'y' are
components, Str may also have component 'add'.  Components 'keep' and
'show' are allowed but must have value True.  If Str has component
'window', its value must be I.  You may not use 'file' or other keywords
related to files as component names.

If Str does not have components 'x' and 'y', the assignment behaves like
showplot() and Str should not have components 'lines', 'linetype',
'thickness', 'impulses', or 'add'.

If Str has components 'x', 'y' and 'symbols', the assignment behaves
like chplot().  With 'add:T', it behaves like addchars().  Str can also
have components 'lines', 'linetype', 'thickness' and 'impulses'.

If Str has components 'x', 'y' and 'strings', the assignment behaves
like stringplot().  With 'add:T', it behaves like addstrings().  Str
must not have components 'lines', 'linetype', 'thickness' or 'impulses'.

If Str has components 'x', 'y' and 'lines' but not 'symbols', the
assignment behaves like lineplot().  With 'add:T', it behaves like
addlines().

If Str has components 'x' and 'y', but not 'symbols', 'strings' or
'lines', the assignment behaves like plot().  With 'add:T', it behaves
like addpoints().  Str can also have component 'impulses' but not
'linetype' or 'thickness'.

In some versions, you can use function Mouse() to create Str with
coordinates taken interactively from a graphics window.  See Mouse() for
details.

Examples:
  Cmd> GRAPHWINDOWS[3] <- structure(x:temp, y:percent, lines:T,\
    symbols:"\1", xlab:"Temperature", ylab:"Percent")

does the same as

  Cmd> lineplot(temp, percent, lines:T, symbols:"\1",window:3,\
    xlab:"Temperature", ylab:"Percent")

Both also create GRAPH variable LASTPLOT which is identical to
GRAPHWINDOWS[3].

  Cmd> GRAPHWINDOWS[4] <- graphVar # GRAPH variable graphVar

does the same as

  Cmd> showplot(graphVar, window:4)

LASTPLOT is created identical to graphVar and GRAPHWINDOWS[4].

  Cmd> GRAPHWINDOWS[1] <- structure(x:17.3, y:25, add:T,\
    strings:"Observations made July 3, 1998", justify:"l")

does the same as

  Cmd> stringplot(GRAPHWINDOWS[1], 17.3, 25, add:T, window:1,\
    strings:"Observations made July 3, 1998", justify:"l")

In some versions
  Cmd> stuff <- Mouse(lines:T,n:10);GRAPHWINDOWS[stuff$window] <- stuff

plots a segmented line with 10 segments with the end and join points
specified by clicking in a graphics window with the mouse.

See also topics 'graphs', 'graph_keys', plot(), lineplot(), chplot(),
stringplot(), showplot(), addpoints(), addchars(), and addstrings().


Gary Oehlert 2003-01-15