Why I think twice before editing plots in Powerpoint, Illustrator, Inkscape, etc.

visualization rants

TLDR: scripting plots is more reproducible and efficient long term

Maxwell B. Joseph true
2015-02-26

Thanks to a nice post by Meghan Duffy on the Dynamic Ecology blog (How do you make figures?), we have some empirical evidence that many figures made in R by ecologists are secondarily edited in other programs including MS Powerpoint, Adobe Illustrator, Inkscape, and Photoshop. I do not do this for two reasons: reproducibility and bonus learning.

Reproducibility

R is nice because results are relatively easy to reproduce. It’s free, and your code serves as a written record of what was done. When figures are edited outside of R, they can be much more difficult to reproduce. Independent of whether I am striving to maximize the reproducibility of my work for others, it behooves me to save time for my future self, ensuring that we (I?) can quickly update my own figures throughout the process of paper writing, submission, rewriting, resubmission, and so on.

I had to learn this the hard way. The following figure was my issue: initially I created a rough version in R, edited it in Inkscape (~30 minutes invested), and ended up with a “final” version for submission.

Figure from Does life history mediate changing disease risk when communities disassemble? [@joseph2013does]

Figure 1: Figure from Does life history mediate changing disease risk when communities disassemble? (Joseph et al. 2013)

Turns out that I had to remake the figure three times throughout the revision process (for the better). Eventually I realized I should to make the plot in R than to process it outside of R.

In retrospect, two things are clear:

  1. My energy allocation strategy was not conducive to the revision process. I wasted time trying to make my “final” version look good in Inkscape, when I could have invested time to figure out how to make the figure as I wanted it in R. The payoff from this time investment will be a function of how much manipulation is done outside R, how hard it is to get the desired result in R, and how many times a figure will be re-made.
  2. I probably could have found a better way to display the data. Another post perhaps.

Learning

Forcing myself to remake the figure exactly as I wanted it using only R had an unintended side effect: I learned more about base graphics in R. Now, when faced with similar situations, I can make similar plots much faster, because I know more graphical parameters and plotting functions. In contrast, point-and-click programs are inherently slow because I’m manually manipulating elements, usually with a mouse, and my mouse isn’t getting any faster.

Joseph, Maxwell B, Joseph R Mihaljevic, Sarah A Orlofske, and Sara H Paull. 2013. “Does Life History Mediate Changing Disease Risk When Communities Disassemble?” Ecology Letters 16 (11): 1405–12. https://doi.org/10.1111/ele.12180.

References

Corrections

If you see mistakes or want to suggest changes, please create an issue on the source repository.

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Source code is available at https://github.com/mbjoseph/mbjoseph.github.io, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".