Basic skills in R: Basic graphics
Summary of arguments to high-level plotting functions
There are a number of arguments which may be passed to high-level graphics functions, as follows:
add = TRUE |
Some functions only: it forces the plotting function to act as a low-level plotting function, superimposing the plot on the current plot. | ||||||||||||||
axes = FALSE |
It suppresses generation of axes—useful for adding your own custom axes with the function axis(). The default, axes=TRUE, means include axes. |
||||||||||||||
log = "x"log = "y"log = "xy" |
This causes the \(x\)-axis, \(y\)-axis, or both axes to be logarithmic. This will work for many, but not all, types of plot. | ||||||||||||||
type = letter |
The argument type controls the type of plot produced, as follows:
|
||||||||||||||
main = string |
It places a title of a figure at the top of the plot in a large font. | ||||||||||||||
sub = string |
It places a sub-title of a figure at the bottom of the plot in a smaller font. | ||||||||||||||
xlab = stringylab = string |
It places axis labels for the \(x\)- and \(y\)-axes. Use these arguments to change the default labels, usually the names of the objects used in the call to the high-level plotting function. | ||||||||||||||
xlim = x_rangeylim = y_range |
You can specify ranges of the horizontal and vertical axis by setting the argument xlim and ylim, respectively. A range is specified as c(begin, end). |
||||||||||||||
las = 0,1,2 |
Orientation of axis labels: 0 means always parallel to axis, 1 means always horizontal, and 2 means always perpendicular to the axis. | ||||||||||||||
mai = c(s1, s2,\(\phantom{abcdefi}\) s3, s4)mar = c(s1, s2,\(\phantom{abcdefi}\) s3, s4) |
Specifation of the size of the margins in a plotting function , where s1, s2, s3, and s4 are the sizes of the bottom, left, top and right margins, respectively, measured in inches (in case of mai) or in the number of text lines (in case of mar). |
Unlock full access