Graphics Reference
In-Depth Information
dashed rather than solid), how thick to draw the line and even a method for how to
deal with the ends of the line (should they be rounded or square?).
When producing plots, you deal with more complex graphical output than just
a single line, and more complex graphical components have their own sets of param-
eters. For example, when drawing an axis, one parameter might control the number
of tick marks on the axis and another might control the text for the axis label. When
drawing acomplete plot, an important parameter isthe data to plot(!),but there may
also be parameters to control whether axes are drawn, whether a legend (or key) is
provided, and so on.
Whereverthereisaparametertocontrol someaspectofgraphical output,theuser
should have the ability to provide a value for that parameter.
In R,eachgraphicsfunctionprovidesasetofparameterstocontrolaspectsofthe
output. he following code shows how a plot can be created with no axes and no
labels by specifying arguments for axes and ann respectively. A line is added tothe
plot with control over its location and its colour, line type and line width.
> plot(1:10, axes=FALSE, ann=FALSE)
> lines(1:10, col="red", lty="dashed", lwd=3)
Graphical Parameters
here is a common set of 'graphical' parameters that can be applied to almost any
graphical output to affect the appearance of the output. his set includes such things
as line colour, fill colour, line width, line style (e.g. dashed or solid) and so on. his
roughly corresponds to the concept of graphics state in the PostScript language.
In order to be able to have complete control over the appearance of graphical
output, it is important that statistical graphics sotware provides a complete set of
graphical parameters. Examples of parameters that may sometimes be overlooked
Figure . . Line join and line ending styles. hree thick lines have been drawn with different line end
and line join styles. he top line has'square'endsand'mitre'joins,themiddle line has 'round' ends and
'round' joins, and the bottom line has 'butt' ends and 'bevel' joins. In each case, the three points that the
line goes through are indicated by black circles
Search WWH ::




Custom Search