Menu

Matplotlib Publication-Ready Upgrader

Paste your matplotlib code below. This tool checks for the 10 most common issues that prevent figures from meeting journal requirements - and shows you exactly how to fix each one.

176 figures generated using this tool this month

The 10 Most Common Matplotlib Publication Failures

Whether or not you paste code above, here is the complete reference for every common issue that prevents matplotlib figures from meeting journal standards.

1. DPI Too Low

Figure appears blurry or pixelated when printed or viewed at journal column width.

Add dpi=300 (or 600 for line art) to savefig().

2. Font Size Too Small

Axis labels and tick marks become unreadable when the figure is scaled to single-column width (89 mm).

Set font sizes via rcParams before creating the figure. Use 7-9 pt for journal figures.

3. Figure Size Wrong

Figure looks fine on screen but text and lines are disproportionate in the paper.

Set figsize to journal column width from the start (e.g., 3.5 in for Nature single-column).

4. Legend Overlaps Data

Legend covers data points, obscuring important information in the figure.

Place legend outside the plot area using bbox_to_anchor, or use frameon=False for transparency.

5. Colors Not Colorblind-Accessible

Red-green color combinations are indistinguishable to ~8% of male readers.

Use colorblind-safe palettes: blue (#0072B2), orange (#E69F00), green (#009E73).

6. Missing or Wrong Tick Formatting

Scientific notation inconsistent, no minor ticks, or tick labels overlap.

Add minor ticks with AutoMinorLocator and control scientific notation with ScalarFormatter.

7. Scientific Notation Inconsistent

Some axes show scientific notation while others do not, or the multiplier is awkwardly placed.

Set scilimits consistently across axes and adjust offset text font size.

8. Line Weight Too Thin for Print

Lines disappear or become invisible when the figure is printed or converted to PDF.

Use linewidth >= 1.2 for data lines and 0.6-0.8 for spines and ticks.

9. Whitespace and Padding Problems

Labels clipped, too much empty space, or axis labels cut off when saved.

Always call tight_layout() and save with bbox_inches="tight".

10. Raster vs Vector Format Confusion

Graphs exported as PNG/TIFF have pixelated text. Photographs exported as EPS/SVG have huge file sizes.

Use PDF/EPS for data plots (vector). Use TIFF at 300+ DPI for photographs (raster).

Frequently Asked Questions

Why does my matplotlib figure look fine on screen but terrible in print?

Screen resolution is typically 72-96 DPI. Print requires 300+ DPI. Also, your screen figure is probably displayed at a different size than the journal column width - elements that look good at 6.4 inches wide become too small at 3.5 inches.

Should I use plt.tight_layout() or fig.tight_layout()?

fig.tight_layout() is more explicit and works consistently. Call it after adding all plot elements and before savefig(). For complex multi-panel layouts, consider fig.subplots_adjust() or constrained_layout=True.

What is the difference between savefig dpi and figure dpi?

The figure dpi (set during creation) affects screen rendering. The savefig dpi overrides this for the output file. Always set dpi in savefig() to control your output resolution independently of screen display.

How do I make matplotlib figures match a specific journal style?

Create a custom rcParams dictionary with the journal requirements (figure width, font, font sizes, line widths) and apply it at the start of your script. Libraries like SciencePlots provide pre-built journal style sheets. Or describe the journal requirements to Plotivy and it generates correctly formatted code automatically.