In graduate school, I took an advanced statistics course that changed my life. The professor placed a large emphasis on creating effective figures from data. He said, “Clear writing is the mark of a great scientist. But writing well and creating beautiful figures…that’s a god” (I’m paraphrasing of course, this was many years ago).
Since that course, I became obsessed with creating effective visualizations. I began reading the works of Edward Tufte and devoted time to master the R package ggplot2
. I would ask for feedback on all my figures and mold them until they were perfect. Still to this day, my goal is for someone to understand a paper I publish by simply reviewing the figures.
But as anyone who works with quantitative data knows, this process is tedious and a painful, especially when there are major edits to be made to a figure or diagram. Just the other day, a colleague of mine was trying to perfect a ggplot2
figure legend for hours (then days) because legends are notoriously difficult to create using programming languages. Is there a simpler way?
Over the years, I have crafted a pipeline for creating figures that makes things less tedious while still maximizing clarity. This pipeline uses a Mac-only program; however, I imagine substituting this software for a Windows-friendly program would also work.
First, create the figure using a programming language.
My first choice is the ggplot2
package in R; however, one can use python or whatever language you want (that supports graphic displays of course). Try to get the figure in as close to a final form as possible. It’s OK if the legend is ugly or even missing altogether. Crucially, your goal is to get feedback from others. Send it to people you trust for honest feedback, and at least a few people outside your discipline. Look out for comments that suggest something about the figure was not obvious—changes that address this topic will help make the message of your figure pop. Because you are working closest with these data, it’s likely that you are biased and see things differently than someone who is less familiar.
Incorporate these changes (as you see fit), and send it back for additional comments. The goal here is to get rapid feedback to improve the figure quickly. Mold your figure until everything is in a great shape, even if not perfect. The next step is for perfecting the figure with small details and easily exchangeable aesthetics, like color and legends.
For the next step to work effectively, I like to save the “almost ready” figure as a scalable vector graphics file (i.e., SVG file)—not a PNG or JPEG. This is an important distinction.
Second, use Omnigraffle to put on the final touches.
There is a beautiful program out there that I use called Omnigraffle. It’s a Mac-only program and I’m probably one of their loudest proponents. In fact, I even was invited on their podcast to discuss the product! (You can listen here).
The advantage of exporting from R as an SVG file is that every single component of the figure is modifiable in Omnigraffle. For instance, you can change the font, the colors, the size, the line widths/types, the legend position, place text anywhere on the plot, combine plots, etc. One of my favorite things to do is to create custom legends in Omnigraffle and place them anywhere I want with ease.
Tip! Once your figure is placed into Omnigraffle, grab all the elements of the figure and group them into one object. Select that object and copy/paste into the same canvas so that both objects are alongside each other. Leave one object as the “original” in case you mess up.
Once you’ve placed the finishing touches on the figure, it’s time for some more feedback. Given that the figure is in pretty good shape by now, the feedback should mainly be cosmetic. It’s easy to select objects from your plot and change as needed. Be careful not to move any of the plot objects that are critical to the integrity of the plot. Adhere to one of Tufte’s main principles, “Graphical excellence requires telling the truth about the data” (p. 51; The Visual Display of Quantitative Information). As long as you are not moving any of the lines, points, bars, etc. from the plot itself, you will be fine.
Third, export your figure.
Another advantage of Omnigraffle is that it supports the export of several different file formats, including TIFF, PNG, JPG, PDF, EPS, and SVG. So whether you are blogging, sharing with colleagues, or publishing in a journal, you can find a file format that is best suited for your needs.
Summary
My pipeline for making publication ready figures from quantitative data is ggplot2
—> feedback from others —> Omnigraffle —> feedback from others —> export final version.
If I need to create a figure describing the study or experimental protocol, I just go straight into Omnigraffle.