Preparing figures for publications

August 22, 2024

I started to realize that, when mentoring students, I often have to repeat the same comments about figures for manuscripts and reports. For reference, here is a list of Do's and Don'ts of scientific illustrations.

Do:

  • Ensure that all written elements (legends, axis labels, titles) are legible and approximately of the same size as the font in the manuscript in which they are to be integrated
  • Align every element that should be aligned (i.e., not approximately aligned, exactly)
  • Ensure consistent spacing across elements that should be consistently spaced (i.e., not what is consistent to your eye, but numerically consistent). 
  • Ensure that all axes are labeled and have units (when units are defined)
  • Ensure that no graphical elements are pixelated
  • Cite your source for reused material
  • As much as possible, work in vectorial format. Output your final figure in high-res as the last step.
  • If you know how to code, code as much as possible of the generation of the figure. This helps ensure consistency and reliability, and facilitates your work when you need to update them.
  • Ensure uniformity in size, shapes, and fonts across the figure and panels in a multi-panel figure.
  • Optimize your figure real estate (imagine that you have to pay [and sometimes you do] for every square inch of the figure... you should have a maximal information/square inch ratio)
  • Spell-check written text. 
  • Use latex rendering of mathematical elements when possible (matplotlib does support that)
  • Get inspired by looking at image galleries (I like Seaborn's https://lnkd.in/gR6_CbyU)
  • Show confidence intervals when relevant
  • Show statistical significance (e.g., using "*" and brackets is customary)
  • Specific if Y in X +/- Y is an SD, an SEM, or an interval of confidence (and what percentage). 
  • Be mindful about sharing axes and color bar scales across panels. A shared axis makes visual elements comparable at the price of often reducing the dynamic range within each panel... do your readers need to compare across panels or do they need to focus on within-panel differences?
  • Get rid of redundant axes labels to optimize your space (e.g., in matplotlib, you can use sharex and sharey attributes for that)
  • Use insets to focus on details when relevant

Don't:

  • Alter the aspect ratio of the figure (i.e., squeeze it vertically or horizontally). This is the hallmark of sloppy work.
  • Use "coding labels" instead or "human-readable labels" (i.e., "eeg_alpha_c" vs "EEG alpha band - Controls")

Good scientific figures are works of art; you should apply yourself to make sure you can be proud of yours. Besides, it is a self-satisfying process.

 

Some additional comments on generating figures for publications in Python:

import matplotlib.pyplot as plt

# Actual printing size in inches
width = 7 
height = 5
fig, ax = plt.subplots(1, 1, figsize=(width, height))
# Note, for data analysis on the screen, I often use
# things like figsize=(20, 15). Works well with Seaborn
# on big screen. These values ARE NOT acceptable for 
# printed material, just for data exploration on the screen.

# If you need to adjust the font size. This font size NEEDS to
# be proportional to the font size of the manuscript.
# It is also possible to control this more finely: 
# https://stackoverflow.com/a/39566040
plt.rcParams.update({'font.size': 12})

# ... do your plotting stuff ...

# Ensure there is no big ugly white margins
fig.tight_layout()

# Publication figures need to be at 300 DPI.
fig.savefig("file_name.png", dpi=300)