Publication-Quality Formatting

From Notebook Sketch to Journal Figure

A figure that looks good in Jupyter often fails at the journal stage: fonts are too small, linewidths vanish at print scale, and file format is wrong. This section teaches the formatting rules for IEEE, Springer, and ACM venues β€” covering fonts, DPI, figure sizes, and export formats.

Definition:

rcParams β€” Global Style Configuration

matplotlib.rcParams is a dict-like object controlling every default:

import matplotlib.pyplot as plt

plt.rcParams.update({
    'font.family': 'serif',
    'font.serif': ['Times New Roman'],
    'font.size': 10,
    'axes.labelsize': 11,
    'axes.titlesize': 12,
    'xtick.labelsize': 9,
    'ytick.labelsize': 9,
    'legend.fontsize': 9,
    'figure.figsize': (3.5, 2.5),
    'figure.dpi': 150,
    'savefig.dpi': 300,
    'lines.linewidth': 1.5,
})

Use plt.rcdefaults() to reset to defaults.

Define rcParams at the top of your script, not scattered through plotting code. Consider a project-wide matplotlibrc file.

Definition:

IEEE Transactions Figure Specifications

IEEE requires:

  • Single column: 3.5 inches wide; double column: 7.16 inches
  • Font size: minimum 8 pt in the printed figure
  • Format: EPS or PDF (vector), or TIFF at 600 DPI (raster)
  • Font: preferably Times New Roman or Computer Modern
IEEE_SINGLE = {
    'figure.figsize': (3.5, 2.625),   # 4:3 aspect
    'font.family': 'serif',
    'font.size': 8,
    'savefig.dpi': 600,
    'savefig.format': 'pdf',
}

Theorem: DPI-Size Relationship

The pixel dimensions of a saved figure are:

pixelsw=figsizewΓ—DPI,pixelsh=figsizehΓ—DPI\text{pixels}_w = \text{figsize}_w \times \text{DPI}, \quad \text{pixels}_h = \text{figsize}_h \times \text{DPI}

For a 3.5 in Γ—\times 2.5 in figure at 300 DPI, the output is 1050Γ—7501050 \times 750 pixels. At 600 DPI, it is 2100Γ—15002100 \times 1500 pixels.

Set figsize to the physical print size (in inches) and DPI to the journal requirement. Never resize the figure after export.

Example: Complete IEEE-Ready BER Figure

Create a publication-quality BER curve with IEEE formatting that passes journal submission requirements.

Example: Using LaTeX in Labels and Annotations

Add properly typeset mathematical labels using Matplotlib's built-in mathtext renderer (no LaTeX installation required).

Common rcParams Cheatsheet

Common rcParams Cheatsheet
The most commonly used rcParams grouped by category: fonts, lines, axes, figure, and saving.

Figure Export Formats

FormatTypeQualityFile SizeBest For
PDFVectorLosslessSmallJournal papers, LaTeX
SVGVectorLosslessSmallWeb, presentations
PNGRasterDPI-dependentMediumSlides, reports
TIFFRasterDPI-dependentLargeSome journals
EPSVectorLosslessSmallLegacy LaTeX workflows

Common Mistake: Font Size Depends on Figure Size

Mistake:

Setting font.size=10 but figsize=(12, 8). When the figure is shrunk to column width in the paper, the 10pt font becomes ~4pt β€” unreadable.

Correction:

Set figsize to the final print size (e.g., 3.5 in for IEEE single column). Then 8pt font in the script stays 8pt in print.

Key Takeaway

Set figsize to the final print dimensions first, then adjust font sizes. If the figure will be 3.5 inches wide in the paper, use figsize=(3.5, 2.5) and choose fonts that look right at that size. Never rely on scaling after export.

Quick Check

A figure is saved with figsize=(3.5, 2.5) and dpi=300. What are the pixel dimensions?

350 x 250

1050 x 750

3500 x 2500

700 x 500

Historical Note: The Viridis Revolution

2015

In 2015, Matplotlib switched its default colormap from jet to viridis, designed by StΓ©fan van der Walt and Nathaniel Smith. Viridis was optimized for perceptual uniformity, colorblind-friendliness, and grayscale printability. The change sparked a broader movement across scientific software toward perceptually uniform colormaps.

DPI (Dots Per Inch)

The resolution of a raster image. Higher DPI means more pixels per physical inch, resulting in sharper prints.

rcParams

Matplotlib's global configuration dictionary controlling all default visual properties.