Published May 17, 2009 | https://doi.org/10.59350/j3ed6-7aj68

ggplot2 quickly makes beautiful plots in R

Creators & Contributors

Earlier I wrote about the open-source free tools I use to plot and analyze my data—Python and R. One of the most time-consuming and fiddly parts of making graphs for our papers is the need to:

  • plot multiple subsets of the data (different experimental conditions), sometimes with double axes
  • make a whole array of plots, one for each of the experimental participants' data

I've been doing this in python with scipy by coding an outer loop iterating over the different participants' data and the inner loop iterating through the experimental conditions. I also write code to label all the conditions and participants, put the horizontal axes only on the bottom-most plots, the vertical axis only on the left-most plots, and sometimes code to offset the different conditions' data points slightly so they don't completely occlude each other. This can be a huge pain.

Recently Dani has discovered a much better way. There is a library of R code called ggplot2 that does all these things for you and more to yield really beautiful and clean arrays of plots. Dani has posted an example of the few lines of code needed and the resulting plot. Ideally I would like to do all this in Python without having to use R but the ggplot2 R library is wonderful and I haven't seen anything remotely like it (yet) for Python.

Files

10.59350_j3ed6-7aj68.pdf

Files (97.6 kB)

Name Size Download all
md5:9dc93938bfeafc0483f7a8893c92a5d7
97.6 kB Preview Download

Additional details

Description

Earlier I wrote about the open-source free tools I use to plot and analyze my data—Python and R. One of the most time-consuming and fiddly parts of making graphs for our papers is the need to: plot multiple subsets of the data (different experimental conditions), sometimes with double axes make a whole array of plots, one for each of the experimental participants' data I've been doing this in python with scipy by coding an outer loop iterating

Identifiers

GUID
http://alexholcombe.wordpress.com/?p=107
URL
https://alexholcombe.wordpress.com/2009/05/18/107

Dates

Issued
2009-05-17T00:00:00Z
Updated
2009-05-28T12:00:55Z