Next: cimag() Up: MacAnova Help File Previous: cholesky()   Contents


chplot(x,y [, symbols:c] [, add:T, lines:T, impulse:T] [,graphics
  keyword phrases]), where x is a REAL vector or scalar, y is a REAL
  vector or matrix and c is a integer or CHARACTER scalar, vector, or
chplot([Graph,] [x,y, symbols:c], keys:str), str a structure whose
  component names are graphics keywords such as 'add', 'lines' and

Keywords: plotting
chplot(x,y,symbols:c) makes a scatter plot of REAL vector or matrix y
versus REAL vector x using plotting symbols as specified by CHARACTER or
REAL vector c.

It is not an error when x or y is NULL; a warning message is printed and
no plotting occurs.

For backward compatibility with earlier versions, you can omit keyword
'symbols', as in chplot(x,y,c).

chplot(Struc,symbols:c), where Struc is a structure with at least two
REAL components, is equivalent to chplot(Struc[1], Struc[2], symbols:c).
For example, chplot(x,y,symbols:c) and chplot(structure(x,y),symbols:c)
are equivalent.  Any components beyond the first two are ignored.

chplot(graph,x,y,symbols:c) or chplot(graph,Struc,symbols:c), where
graph is a GRAPH variable, draws the plot encapsulated in graph, adding
to it the new information.  See topic 'graph' for details on adding
information to a plot.

When c is REAL, each element c[i] must be an integer with 0 <= c[i] <=
999 and the plotting symbol will be the number centered at the plotting

When c is a CHARACTER scalar with value "###", the characters plotted
are the same as when symbols:c is omitted; see below.

When c is CHARACTER other than the scalar "###", up to 3 characters from
each c[i] will be drawn centered at the plotting point.

Argument symbols:c may be omitted.  In this case the default plotting
characters are as follows:
  y a vector:                   The row number of an element y
  y a matrix with ncols(y) > 1: The column number of an element

chplot(x,y [,symbols:c], add:T, ...) does the same as chplot(LASTPLOT,
x, y [,symbols:c), that is, plotted points are combined with the data
already in LASTPLOT.

chplot([graph,] x,y, lines:T [,symbols:c]) makes a character plot,
connecting the points by lines similarly to lineplot().

chplot([graph,] x,y, impulse:T [,symbols:c] [,lines:T]) does the same
except that vertical lines will be drawn to the points from the x = 0

When option 'dumbplot' has been set False (see subtopic
'options:"dumbplot"'), the plot will be a low resolution plot unless
'dumb:F' is an argument.

When c has more than 1 column then you must have ncols(c) = ncols(y) and
the elements in c[,j] will be used to plot y[,j], reusing the rows of c
cyclically if nrows(c) < nrows(y).

When c is a vector of length ncols(y), c[j] will be used to plot all
elements of the column y[,j]

Otherwise, if c is a vector with length(c) != ncols(y), c[i] will be
used to plot all elements in the row y[i,], reusing the rows of c
cyclically if nrows(c) < nrows(y).

                         Drawn plotting symbols
When the first character of an element of a CHARACTER c has ASCII code V
between 1 and 31, it designates a specially drawn character.  There are
8 basic shapes in three sizes, diamond (V=1, 9, 17), plus sign (V=2, 10,
18), square (V=3, 11, 19), cross (V=4, 12, 20), triangle (V=5, 13, 21),
star (V=6, 14, 22), dot (V=7, 15, 23) and circle (V=8, 16, 24).  Codes
1 - 8 are the standard sizes; codes 9 - 16 are about 2/3 standard size
and 17 - 24 are about 1/2 standard size.  There is only one size dot.
Codes 25 - 31 "wrap around" to 1 - 7.

You can specify these special ASCII codes using quoted strings "\1",
"\2", "\3", "\4", "\5", "\6", "\7", "\10", "\11", ... ,"\17", "\20",
..., "\27", "\30", ..., "\37".  The digit or digits are the octal
representations of the codes.  For example, "\3" represents an ASCII 3
and specifies a standard size square, "\10" represents an ASCII 8 and
specifies a standard size circle, and "\27" represents 22, the smallest
size star.  They can also be specified using escaped hexadecimal codes
"\x01", "\x01", "\x02", ..., "\x09", "\x0a", ..., "\x1f".

You can also specify these codes by name, using function makesymbols().
For example, chplot(x,y,symbols:makesymbols("diamond",medium:T)) makes
the same plot as chplot(x,y,symbols:"\11").  See makesymbols() for

See topic 'graphs' for the use of a scalar or length 2 vector for x.

Use keyword phrase 'add:T' or commands addchars(), addlines(),
addpoints() and addstrings() to add information to a plot.

Keywords 'dumb', 'lines', 'linetype', 'thickness', 'impulse', 'xmin',
'xmax', 'ymin', 'ymax', 'logx', 'logy', 'xlab', 'ylab', 'title',
'xaxis', 'yaxis', 'borders', 'ticks', 'xticks', 'yticks', 'xticklen',
'yticklen', 'xticklabs', 'yticklabs', 'height', 'width', 'pause',
'silent' and 'notes' may be used as for other plotting commands.  See
topics 'graph_keys', 'graph_border' and 'graph_ticks'

See topic 'graph_assign' for information on another way to make plots.

chplot([Graph,] keys:structure(x:x,y:y,symbols:c [other keyword
phrases)) is equivalent to chplot([Graph,] x:x,y:y, symbols:c [other
keyword phrases]).  See topic 'graph_keys' for details.

See topic 'graph_files' for information on how to save a plot in a file
using keywords 'file', 'new, 'ps', 'screendump', and 'epsf'.

See topics 'macintosh' and 'wx' for information on how to print graphs
in windowed versions (Macintosh, Windows, Motif).

  Cmd> chplot(x,y,symbols:"*")
makes a plot of y vs x with "*" as plotting symbol.

Suppose x[,1] contains integers 1, 2, or 3.  Then

  Cmd> chplot(X2:x[,2],X3:x[,3], symbols:vector("A","B","C")[x[,1] ],\
        title:"X3 vs X2")

makes a plot of column 3 of x against column 2, using plotting symbols
"A", "B", or "C", according as the value in column 1 of x is 1, 2 or 3.
Axes are labeled 'X2' and 'X3' and a title is printed.

  Cmd> chplot(X:1,run(20)^(.2*run(5)'),\
        symbols:vector(".2",".4",".6",".8","1.")', ylab:"Powers of X",\
        title:"X^.2, X^.4, X^.6, X^.8, and X",lines:T)

draws line connected plots of x^.2, , x^.4, x^.6, x^.8 and x vs x, using
plotting symbols ".1", ".4", ...,"1.0" for each line.  X:1 is equivalent
to X:run(20).  See subtopic graphs:"specification_of_data" for details.

See also topics 'graphs', plot(), lineplot(), showplot(), addchars(),
addlines(), addpoints(), colplot(), rowplot(), tek(), vt().

Gary Oehlert 2003-01-15