Python Script
~6 KB
Free
Matplotlib Publication Figure Template
A Python script with pre-configured rcParams and helper functions that produce clean, publication-ready figures matching journal style guides — without wrestling with matplotlib defaults.
Check your inbox!
The download link is on its way. Can't find it? Check spam.
Download directly instead →What's Included
- rcParams preset for journal-quality output (300 DPI, correct font sizes)
- Single-column and double-column figure size helpers
- Clean colour palettes (colour-blind friendly)
- Helper functions: annotate_significance(), add_panel_labels(), save_fig()
- Line plot, bar chart, scatter plot, and boxplot examples
- LaTeX-compatible font rendering settings
- requirements.txt with matplotlib, numpy, scipy
Who This Is For
- Researchers submitting to journals with strict figure formatting requirements
- PhD students producing thesis figures that look professional
- Anyone tired of reformatting matplotlib output before submission
What Makes a Publication-Quality Figure
Journal requirements typically demand:
- 300 DPI minimum (often 600 for line art)
- Figure width: 86 mm (single column) or 176 mm (double column) — exact values depend on journal
- Font size: 8–10pt for axis labels, consistent with body text
- No chart junk: white background, no box spines, minimal grid lines
- Colour-blind friendly palettes (avoid red/green alone)
This template sets all of these automatically. A single import figure_styles at the top of a notebook applies the preset.
Example Usage
import matplotlib.pyplot as plt
import numpy as np
from figure_styles import apply_journal_style, save_fig, single_col_width
apply_journal_style()
fig, ax = plt.subplots(figsize=(single_col_width, single_col_width * 0.75))
ax.plot(x, y, color='#2563eb', lw=1.5, label='Treatment')
ax.set_xlabel('Time (days)')
ax.set_ylabel('Response (AU)')
ax.legend(frameon=False)
save_fig(fig, 'my_figure', formats=['pdf', 'svg'])
Output: my_figure.pdf and my_figure.svg at the correct DPI, ready for submission.
Ready to get started?
Enter your email and I'll send the link straight to your inbox.
Check your inbox!
The download link is on its way. Can't find it? Check spam.
Download directly instead →Prefer to browse the source? View on GitHub →