* You are viewing Posts Tagged ‘ggplot2’

Part 2: Make your R figures legible in Powerpoint/Keynote presentations

In the previous post, I outlined some tips for increasing the size of figure labels for figures that are meant to be displayed on a projector. The previous post used the base R plot() function, but the procedure when plotting with ggplot2 is different and usually quite a bit simpler than the stock R plotting functions. As before, I’m outputting the figures here as 1024×768 PNG image files, since they’re sure to work in whatever version of PowerPoint or Keynote you’re stuck using.

I’ll begin by generating some random data and dates to use in the plots. … Continue Reading

A simple ggplot2 scatterplot revisited

Rick Wicklin contacted me with a helpful suggestion for improving the data presentation method outlined in my  previous post on using ggplot2 to visualize some data. In the previous post I had plotted up a highly correlated set of points, showing the correspondence between maximum daily body temperatures of model snails sitting with the foot touching the rock surface, or withdrawn into the shell.

The original figure.

Rick points out that with a bit of data manipulation, you can replot these … Continue Reading

A simple ggplot2 scatterplot

Here’s a bit of code used to produce one of the figures in my recent paper dealing with modeling rocky intertidal snail body temperatures. This was my first foray into ggplot2, and it only involved a few hours of head-scratching. The plot is a comparison of 10 years of  daily maximum body temperatures of a modeled littorine snail sitting on a rock with its foot out on the rock or withdrawn into the shell. The original data are here: dailymax_runs139_169.

The code below will open the data file, create the ggplot2 figure, and save the output … Continue Reading