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:
Get The R Book now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.