CLI Reference¶
PlotStyle includes a plotstyle command for inspecting journal specs, checking fonts, and validating saved files without writing any Python.
Commands at a glance¶
Command |
What it does |
|---|---|
|
List all supported journal presets |
|
Show a journal’s full specification |
|
Compare two journal specs side by side |
|
List all available overlays |
|
Show an overlay’s rcParams in detail |
|
Check font availability for a journal |
|
Check font availability for an overlay |
|
Check a PDF for Type 3 font issues |
|
Print a Python re-export snippet |
Journal discovery¶
plotstyle list¶
List all supported journal presets with their publishers:
$ plotstyle list
acm Association for Computing Machinery
acs American Chemical Society
cell Cell Press
elsevier Elsevier
ieee IEEE
nature Springer Nature
plos Public Library of Science
prl American Physical Society
science AAAS
springer Springer Nature
usenix USENIX Association
wiley Wiley
plotstyle info <journal>¶
Show the full specification for a journal: dimensions, typography, export requirements, and accessibility rules.
$ plotstyle info nature
Journal: Nature
Publisher: Springer Nature
Source: https://www.nature.com/documents/nature-final-artwork.pdf
Last Verified: 2026-04-30
──────────────────────────
Dimensions:
Single column: 89.0mm (3.50in)
Double column: 183.0mm (7.20in)
Max height: 170.0mm
Typography:
Font: Helvetica, Arial (fallback: sans-serif)
Size range: 5.0-7.0pt
Target size: 7.0pt
Panel labels: 5.0pt bold lower (a, b, c)
Export:
Formats: ai, eps, pdf
Min DPI: 300
Color: rgb
Accessibility:
Colorblind safe: Not required
Grayscale safe: Not required
Avoid: none
plotstyle diff <journal_a> <journal_b>¶
Compare two journal specs field by field. Only fields that differ are shown:
$ plotstyle diff nature ieee
Nature → IEEE Transactions
──────────────────────────────────────────────────
Column Width (single): 89.0mm → 88.9mm
Column Width (double): 183.0mm → 182.0mm
Max Height: 170.0mm → 216.0mm
Font Family: Helvetica, Arial → Times New Roman, Helvetica, Arial
Min Font Size: 5.0pt → 9.0pt
Max Font Size: 7.0pt → 10.0pt
Panel Label Size: 5.0pt → 9.0pt
Preferred Formats: ai, eps, pdf → tiff, eps, pdf, png
Colorblind Required: No → Yes
If two journals are identical in all fields, the command prints No differences.
Use diff before migrating a figure from one journal to another to understand what will change.
Overlay discovery¶
plotstyle overlays [--category <category>]¶
List all available overlays. Optionally filter by category:
$ plotstyle overlays --category context
high-vis [context] Maximum contrast, bold lines, and oversized ticks for projected displays.
minimal [context] Stripped-down axes with no top/right spines for editorial and blog use.
notebook [context] Enlarged figures and larger fonts for Jupyter and interactive sessions.
presentation [context] Large text and thick lines for slide decks and posters.
Valid category values: color, context, rendering, script, plot-type.
Run without --category to list all overlays across all categories.
plotstyle overlay-info <overlay>¶
Show the full details for a single overlay, including all rcParams it sets:
$ plotstyle overlay-info notebook
Overlay: Notebook
Key: notebook
Category: context
Description: Enlarged figures and larger fonts for Jupyter and interactive sessions.
──────────────────────────
rcParams:
figure.figsize = [8.0, 5.5]
font.size = 14.0
axes.labelsize = 14.0
xtick.labelsize = 12.0
ytick.labelsize = 12.0
legend.fontsize = 12.0
lines.linewidth = 2.0
axes.linewidth = 1.5
xtick.major.width = 1.5
ytick.major.width = 1.5
For script overlays (such as cjk-simplified), the output also shows required fonts and any LaTeX preamble entries.
Font checking¶
plotstyle fonts --journal <journal>¶
Check which of a journal’s preferred fonts are installed on your system:
$ plotstyle fonts --journal nature
Font check for: Nature
Required: Helvetica, Arial
Available: Helvetica, Arial
Selected: Helvetica
Exact match: Yes
When the preferred font is not installed, PlotStyle falls back to the next available option in the list and prints a warning. To install a font and make it available to Matplotlib, install it at the OS level then rebuild the font cache:
from matplotlib.font_manager import _load_fontmanager
_load_fontmanager(try_read_cache=False)
plotstyle fonts --overlay <overlay>¶
Check which fonts required by a script overlay are installed. Useful for CJK and other non-Latin overlays:
$ plotstyle fonts --overlay cjk-japanese
Font check for overlay: CJK Japanese
──────────────────────────
IPAPGothic: not found ✗
TakaoGothic: not found ✗
Yu Gothic: not found ✗
Noto Sans CJK JP: not found ✗
Noto Serif CJK JP: not found ✗
Hiragino Kaku Gothic Pro: not found ✗
Warning: none of the required fonts are installed.
Non-Latin characters may not render correctly.
--journal and --overlay are mutually exclusive: you must pass exactly one.
Validation¶
plotstyle validate <file> --journal <journal>¶
Check a saved figure file against a journal spec. For PDF files, this checks whether fonts are embedded as TrueType (Type 42) rather than Type 3 bitmap fonts, which most journal submission portals reject.
PDF file:
$ plotstyle validate figure1.pdf --journal nature
Validation against: Nature
✓ PASS No Type 3 fonts detected (TrueType embedding OK).
Note: Full validation requires a live Matplotlib Figure object.
Use plotstyle.validate(fig, journal='nature') in Python
for complete checks (dimensions, typography, colour, line weights).
Non-PDF file:
$ plotstyle validate figure1.png --journal nature
Validation against: Nature
File format: .png
Font embedding check is only available for PDF files.
Note: Full validation requires a live Matplotlib Figure object.
Use plotstyle.validate(fig, journal='nature') in Python
for complete checks (dimensions, typography, colour, line weights).
--journal is required. The command exits with code 1 if the file is not found.
Limitation: the CLI can only check font embedding in saved PDF files. Full validation (dimensions, font sizes, line weights, color rules) requires the live Matplotlib Figure object and must be run in Python:
report = style.validate(fig)
print(report)
Export¶
plotstyle export <file> --journal <journal>¶
Print a ready-to-run Python snippet for re-exporting a figure in all formats the journal requires. No files are created by this command.
Arguments:
Argument |
Required |
Description |
|---|---|---|
|
Yes |
Path to the figure file. The stem is used to name the exports. |
|
Yes |
Journal identifier |
|
No |
Comma-separated format list to override the journal defaults |
|
No |
Author surname for journals that prefix filenames (IEEE) |
|
No |
Output directory for the snippet (default: |
$ plotstyle export figure1.pdf --journal nature
Re-export requires the original Matplotlib Figure object.
Use plotstyle.export_submission(fig, ...) in Python.
Example:
import plotstyle
plotstyle.export_submission(fig, 'figure1', journal='nature')
With optional flags:
$ plotstyle export figure1.pdf --journal ieee --formats pdf,eps --author Smith --output-dir submission/
Re-export requires the original Matplotlib Figure object.
Use plotstyle.export_submission(fig, ...) in Python.
Example:
import plotstyle
plotstyle.export_submission(fig, 'figure1', journal='ieee', formats=['pdf', 'eps'], author_surname='Smith', output_dir='submission/')
The reason re-export cannot happen in the CLI is that a saved image file does not contain the original Matplotlib Figure object. The snippet is meant to be copied into the script that created the figure.
Exit codes¶
Code |
Meaning |
|---|---|
|
Success |
|
Error: bad arguments, unknown journal or overlay key, file not found |
Unknown journal and overlay keys produce a specific error message with a hint:
$ plotstyle info unknown
Error: unknown journal 'unknown'.
Run 'plotstyle list' to see all available journal identifiers.
Exit codes follow POSIX conventions and are suitable for use in shell scripts and CI pipelines.