R Graphics: Plot Parameters

High level plot commands open a graphics device.  High level plot elements add objects.  R plot parameters ensure actual control over the graphics device.

R Plot Parameters

All high level plotting functions have arguments which can be used to customize the plot. barplot(), for example, has arguments to control bar width, styles, etc.  High level functions also take the optional “three dots” argument, which allows for argument sharing.  The most common arguments shared are low level graph parameters from the par() function.

The tables below define graphical parameters by type.  The most commonly used are highlighted with †.  The example notation c denotes one character for input;  i, j, m, and n are integers; L is a logical value; x requires a numeric data object as input:

Layout Parameters

[table id=26 /]

Plot Formatting

[table id=27 /]

Margins

[table id=29 /]

Plot Area

[table id=30 /]

Axes

[table id=31 /]

Text and Symbols

[table id=32 /]

Plot Symbols
Plot symbols are displayed below with their pch=n code:

PlotSym

Anatomy of a Plot

A figure consists of a plot region surrounded by 4 margins:

PlotRegion1          Click to enlarge

The fundamental anatomy fields are critical to managing layout parameters.  For example, the following layout diagram outlines parameters for customizing a 3×2 multi-figure graphic where mfg=c(3,2) with outer margin parameters:

PlotRegion2

Back | Next