5. Graphics

  1. Michael J. Crawley

Published Online: 6 NOV 2012

DOI: 10.1002/9781118448908.ch5

The R Book, Second Edition

The R Book, Second Edition

How to Cite

Crawley, M. J. (2012) Graphics, in The R Book, Second Edition, John Wiley & Sons, Ltd, Chichester, UK. doi: 10.1002/9781118448908.ch5

Author Information

  1. Imperial College London at Silwood Park, UK

Publication History

  1. Published Online: 6 NOV 2012
  2. Published Print: 7 DEC 2012

ISBN Information

Print ISBN: 9780470973929

Online ISBN: 9781118448908



  • graphics, plots with two variables;
  • plotting with two continuous explanatory variables, scatterplots;
  • third variable to label a scatterplot;
  • adding shapes to a plot, and locator function;
  • drawing mathematical, smooth parametric curves to scatterplot;
  • the graphics window, shape and size;
  • boxplots with notches, indicating differences;
  • single sample plots, Pie charts/time series plots;
  • plots with multiple variables, pairs/coplot function;
  • special plots, as design/bubble plots


This chapter contains sections titled:

  • Plots with two variables

  • Plotting with two continuous explanatory variables: Scatterplots

  • Adding other shapes to a plot

  • Drawing mathematical functions

  • Shape and size of the graphics window

  • Plotting with a categorical explanatory variable

  • Plots for single samples

  • Plots with multiple variables

  • Special plots

  • Saving graphics to file

  • Summary