There are many ways to change how R plots charts. The most intuitive is through arguments to a charting function. Another way to customize charts is by setting session parameters. An additional way to change a chart is through a function that modifies a chart (for example, adding titles, trend lines, or more points). Finally, it is possible to write your own charting functions from scratch.
This section describes common arguments and parameters for controlling how charts are plotted.
Conveniently, most charting functions in R share some arguments. Here is a table of common arguments for charting functions.
|add||Should this plot be added to the existing plots on the device, or should the device be cleaned first?|
|axes||Controls whether axes will be plotted on the chart.|
|log||Controls whether points are plotted on a logarithmic scale.|
|type||Controls the type of graph being plotted.|
|xlab, ylab||Labels for x- and y-axes.|
|main||Main title for the plot.|
|sub||Subtitle for the plot.|
This section describes the graphical parameters available
graphics package. In most
cases, you can specify these parameters as arguments to graphics
functions. However, you can also use the
par function to set graphics parameters. The
par function sets the graphics
functions for a specific graphics device. These new settings will be the
defaults for any new plot until you close the device.
par function can be useful if you want to ...