O'Reilly logo

The R Book by Michael J. Crawley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

An Alphabetical Tour of the Graphics Parameters

Beginners cannot be expected to know which graphics attributes are changed with the par function, which can be changed inside the plot function, and which stand alone. This section therefore unites all the various kinds of graphics control into a single list (see Table 27.1): properties that are altered by a call to the par function are shown as par(name), while properties that can be altered inside a plot function are shown in that context; other graphics functions that stand alone (such as axis) are not shown in the table.

When writing functions, you need to know things about the current plotting region. For instance to find out the limits of the current axes, use

par("usr")

[1] 1947.92 2004.08 -80.00 2080.00

which shows the minimum x value par("usr")[1], the maximum x value par("usr")[2], the minimum y value par("usr")[3] and the maximum y value par("usr")[4] of the current plotting region for the gales data (p. 859).

If you need to use par, then the graphics parameters should be altered before you use the first plot function. It is a good idea to save a copy of the default parameter settings so that they can be changed back at the end of the session to their default values:

Table 27.1. Graphical parameters and their default values. Each of the functions is illustrated in detail in the text. The column headed ‘In plot?’ indicates with an asterisk whether this parameter can be changed as an argument to the plot, points or lines ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required