Chapter 4. Plotting data

In this chapter we discuss best practice for plotting data for common experimental designs in biomedical science.

We begin by exemplifying plots created with R, to provide a sense of possibilities.  Next, we discuss what a good visual display of data should do and why.  Finally, we walk through an example of plotting data for experiments with several treatments and focus on the need to display all of the data (not merely mean values) to communicate results transparently.

We will teach data visualization using basic R, not ggplot2 (which can also produce beautiful figures), to keep our approach as simple as possible.  (That said, some would argue that ggplot2 is simpler.)  We provide a link to resources to learn ggplot2, below, for interested users.

The range of ways that we might display data is as diverse as the biological questions we might ask of our data. We recognise that, by focusing on plotting data for factorial experiments, our treatment of plotting data is currently rather thin. For example, students of ecology and evolution would probably like to see examples of plotting data with continuous, independent variables ('covariates' eg, multiple regression).

We aim to provide more support in this area in the future. For the moment, please note that chapters dealing with the analysis of covariates provide some suggestions (and code) to plot such data. We also point you to the resource for ggplot2 (see below) for detailed support for plotting many types of data.