1 of 10

Figure workshop

Anne Urai, 26 February 2024, Leiden University

2 of 10

Principles; plotting for yourself

  • Know your data, know your data, know your data!
  • Plot each individual, relationships between variables, distributions, etc
  • FacetGrid & PairGrid for quick exploration
  • Save folders with many figure variants
    • Name: ensure we can scroll through plots that are the same easily
    • E.g. plotname_brainregion_variant1_variant2.pdf
  • Initially, save as pdf (be careful with transparency -> big filesizes)

3 of 10

Some examples in seaborn

4 of 10

Principles; plotting for your readers

  • Draw different variants of your figures (on paper!) before coding
  • Figures should be standalone (as much as possible): the story of your paper should be understandable from the figures alone
    • Add in annotations, statistics, titles etc
  • Data/ink ratio should be high
    • Remove unnecessary clutter
  • Color is your friend
    • Choose consistent colors throughout figures/panels to guide the reader
  • Limit the number of different font sizes across figures

Advice on figure organisation: https://rajlaboratory.blogspot.com/2017/08/figure-scripting-and-how-we-organize.html

5 of 10

General aesthetics

https://seaborn.pydata.org/tutorial/aesthetics.html

Good example papers for beautiful figures

Today’s example paper: https://www.nature.com/articles/s41467-022-33237-5

6 of 10

Direct labelling

7 of 10

Labeling/legends - don’t try this with code

Lines = model fits

Points = data

8 of 10

Colors & symbols

9 of 10

Annotating (including statistics)

10 of 10

Next steps: combining in Illustrator/InkScape

  • combining + annotating panels in Illustrator
    • Export panels as pdf after tight_layout()
    • Use linked files (careful: absolute paths) until the very end
      • Easy to still change colors, add data, scale axes etc
      • Does not risk accidental moving of datapoints (!!)
    • GitHub README should indicate which code creates which figures�
  • Trick: create a pdf that’s as wide as an A4
  • Export for journal: high-res TIFF vs vector
  • embed all links: before final archiving