Next: halfnorm() Up: MacAnova Help File Previous: graph_keys   Contents

graph_ticks

Usage:
Graphics keywords 'xticks', 'yticks', 'xticklen', 'yticklen', 'ticks',
  'xticklabs', 'yticklabs' are used to modify default tick marks in
  graphs, provide labels for them and specify which sides of a plot they
  are drawn.
Values for 'xticks' and 'yticks' are REAL vectors or NULL.
Values for 'xticklen' and 'ytick' length are REAL scalars >= -1.
Values for 'ticks' must be "all", "none" or a combination of letters 'B"
  (bottom), 'L' (left), 'T' (top) and 'R' (right) or their lower case
  counterparts.
Values for 'xticklabs' and 'yticklabs' must be CHARACTER vectors, ?, or
  NULL



Keywords: plotting
This topic summarizes how you can customize tick positions, appearance
and labelling on graphs.  See topic 'graphs' for general information on
plotting commands and topic 'graph_keys' for information about keyword
phrases.

By default, plotting commands draw tick marks at automatically computed
"neat" positions.  The default tick length is about half the width of a
character.  All tick marks are labeled in the left or bottom margin,
with the default labels being their locations.

You can customize the horizontal and vertical positions of tick marks by
keywords 'xticks' and 'yticks' whose values must be REAL vectors or
NULL.  xticks:NULL and yticks:NULL suppress ticks and their labels
entirely.  xticks:? or yticks:? cause the default tick mark positions to
be used.

You can control the lengths of the tick marks by keywords 'xticklen' and
'yticklen' whose values should be REAL scalars >= -1.  The default
length correspondes to xticklen:.5 and yticklen:.5.  Values < 0 give
ticks outside the border and 0 values suppress drawing ticks but not
their labels.  Values > 2 cause full gridlines from one side of the plot
to the other to be drawn.

By default, tick marks are drawn on any edge of the graph where a border
line is drawn, with full gridlines drawn if a border is drawn at either
end of the line.  You can modify this behavior using 'ticks:word', where
'word' is a quoted string or character scalar.  If 'word' isn't "all" or
"none", it must contain only the characters 'B' (bottom), 'L' (left),
'T' (top) or 'R' (right), or their lower case counterparts 'b', 'l', 't'
and 'r'.  Value "" is equivalent to "none".

Using 'borders:word' without 'ticks' automatically sets the sides where
ticks are drawn to match where borders are drawn.  See topic
'graph_border'.

Regardless of the value of 'ticks', tick labels will always be put at
the bottom and left.

You can replace numerical labels for ticks with arbitrary labels using
keyword phrases 'xticklabs:charvec' and/or 'yticklabs:charvec', where
charvec is a CHARACTER vector.  This is permissible only in the
following situations (described for the x-axis).

 Keyword phrase 'xticks:realvec' is an argument and length(charvec) =
 length(charvec) = length(realvec).

 You are displaying or adding to a existing plot for which x-axis tick
 positions were supplied and length(charvec) = number of such positions.

 You are labelling the "box number" axis on a box plot and
 length(realvec) = number of boxes.

In particular, 'xticklabs' is ignored if default tick positions are
being used, even when charvec is of the right length.

Examples:
  Cmd> plot(x,y,xticks:vector(1,2,4),yticks:NULL,xticklen:1.5,\
   ticks:"B", xticklabs:vector("Fair", "OK", "Super"))

gives x-axis ticks 1.5 times the width of a character (3 times normal)
at x = 1, 2 and 4 on the bottom border only, giving them special labels,
and suppresses all y-axis ticks and their labels.

  Cmd> plot(x,y,xticklen:3,yticklen:-.5, ticks:"BL")
draws full gridlines perpendicular to the x-axis and default length
ticks along the outside of the left edge of the frame.  With ticks:"L",
ticks:"R", ticks:"LR" or ticks:"none", the gridlines would not be drawn
at all.

  Cmd> showplot(xticks:?,yticks:?)
sets the default tick positions, without altering their length.  If
custom tick labels were set, they are discarded.  Use of 'xticklabs' or
'yticklabs' produces a warning message but has no other effect.

See also topics 'graphs' and 'graph_keys'.


Gary Oehlert 2003-01-15