R Graphics Second Edition
by Paul Murrell

A book on the core graphics facilities of the R language and environment for statistical computing and graphics (Chapman & Hall/CRC, August 2011).

A link to the publisher's web page for the book.

A list of Updates.

A list of Errata.

R code for figures:

An R package called "RGraphics" is available from CRAN. This package contains: data sets used in the book (and not available in other existing packages); functions to reproduce the figures in the book, e.g., figure1.1(); and function, method, and class definitions from Chapter 8.

NOTE: version 1.* of the 'RGraphics' package corresponds to the first edition of R Graphics. For this Second Edition, you need at least version 2.0 of the 'RGraphics' package.

NOTE:
The R code presented in these pages is the R code actually used to produce the Figures in the book. There will be differences compared to the code chunks shown in the text of the book, but in most cases the differences will be that these pages contain additional code to lay out multiple plots on a single "page".

Some figures have been fine-tuned to a particular aspect ratio or even physical size, so the code will not reproduce exactly the same figure on a different-sized device.

These figures are raster equivalents or, in a couple of cases, raster conversions of the vector originals. The vector originals are of a much higher quality; these bitmaps are just to make it easier to identify a particular figure.

The code presented for each figure is self-contained, i.e., all code required to produce the figure is included. This means that there is sometimes considerable overlap of code between several figures (where the figures rely on common set-up code, e.g., the definition of variables, functions, or classes). This is particularly evident in the figures for Chapter 7. In some cases, it may be necessary to install an add-on package from CRAN to get the code to run.

Some of the figures from Chapters 2 and 3 (on traditional graphics) were actually produced using grid graphics code; it's just easier to do diagrams with grid sometimes.