This is a repository containing code that I wrote for a lecture given at the 2023 Annual Meeting of the Centre of Excellence for Dark Matter Particle Physics on the subject of how best to make effective figures for papers and talks in physics.
The repository focuses around specific examples of how to improve plots using Matplotlib. Click on any of the examples below to go to a jupyter notebook, or browse some in the /code folder. Most of the examples are made up, however they are inspired by the types of plots that people make in particle physics.
The slides to accompany this lecture can be found here in both pdf and keynote formats. Reading them is probably important to get the context behind why I made this repository. In the talk I went through some motivation behind making good plots, gave some general design advice and highlighted some common pitfalls, before going through a few specific tips for making good-looking figures using Matplotlib.
Please contact me at ciaran.ohare@sydney.edu.au if you have any questions, or spot any errors.
code/Clutter.ipynb
- Reducing clutter in figures with responsible use of pre-attentive attributescode/VisualClarity.ipynb
- Improving visual clarity in line plotscode/Defaults.ipynb
- Changing matplotlib default settings and the use of style sheetscode/MathematicalPlot.ipynb
- Properly labelling plots containing mathematical formulaecode/TablesVersusFigures.ipynb
- Turning tables into effective figurescode/Histograms.ipynb
- Attractive histogramscode/ExclusionLimits.ipynb
- Dark matter exclusion plotscode/DarkMatterLandscape.ipynb
- Dark matter landscape plot showcasing different math fontscode/ComplicatedPlots.ipynb
- How to clean up a complicated plotcode/BoringPlots.ipynb
- How to spruce up boring plots
- code/sty.mplstyle My preferred matplotlib style sheet (Palatino font)
- code/sty2.mplstyle My preferred matplotlib style sheet (CM font)
- code/sty3.mplstyle My preferred matplotlib style sheet (Sans-serif font)