Usage Guide

dartwork-mpl bundles stylistic presets, curated colors/colormaps, and layout/font helpers so you get predictable results fast.

The Evolution of a Plot

Drag the slider to experience the dartwork-mpl pipeline step-by-step.

1. Base 2. Apply Style 3. Label & Format 4. Smart Layout

Choosing the right tools

Which preset?

Your context

Preset

Why

Academic paper / journal

scientific

Compact fonts (7.5 pt), all 4 spines, fits 3.5” column

Business report / memo

report

Clean look, no top/right spines, 8 pt fonts

Infographic / editorial

minimal

Tufte-style, no spines/ticks, data-ink focus

PowerPoint / Keynote

presentation

Large fonts (10.5 pt), readable when projected

Conference poster

poster

Largest fonts (12 pt), thick lines, 1-2m reading distance

Web docs / blog

web

Screen-optimized 11 pt, clean for HTML/Jupyter

Dark Jupyter / dark slides

dark

Inverted colors on #1e1e1e background

Any of the above + Korean

Add -kr suffix

Swaps to Paperlogy/Pretendard fonts

Which layout function?

Situation

Function

Notes

Most figures

simple_layout(fig)

Fast, consistent margins via L-BFGS-B optimizer

Long labels or multi-line titles

auto_layout(fig)

Detects and fixes text overflow automatically

Multi-panel with GridSpec

simple_layout(fig, gs=gs)

Respects your hspace/wspace settings

Need exact margin control

simple_layout(fig, margins=(...))

Specify margins in inches

Which color palette?

Style

Prefix

Best for

Open Color

oc.*

General purpose, well-balanced (recommended default)

Tailwind CSS

tw.*

Web-style designs, wider shade range (50–950)

Material Design

md.*

Google-style, vibrant

Ant Design

an.*

Enterprise UI aesthetics

Chakra UI

ch.*

Modern web app colors

Primer

pr.*

GitHub-style, subtle

Typical workflow

1. Pick a style

dm.style.use("scientific") sets fonts, line weights, spines, and tick styling in one call — 7 presets cover papers, reports, slides, posters, web, and dark mode. No manual rcParams guessing.

Styles and Presets

2. Add color

Use named colors like "oc.blue5" or "tw.emerald500" anywhere matplotlib accepts a color string. 900+ curated swatches from 6 design systems, plus perceptual OKLCH interpolation.

Colors and Colormaps

3. Layout & annotate

dm.simple_layout(fig) optimizes margins via L-BFGS-B — uniform spacing even with colorbars and long labels. dm.label_axes() adds panel labels automatically.

Layout and Typography

4. Export

dm.save_formats(fig, "output/fig", formats=("png", "svg")) writes multiple formats at once. Add validate=True to auto-detect overflow, overlap, and crowding before saving.

Save and Validation

5. Interactive UI

Launch a local web UI to tweak parameters with sliders, download plots, and generate reproducible Python scripts on the fly.

Interactive UI

Tip

Where do assets live? Style files are in asset/mplstyle/, colors in asset/color/, fonts in asset/font/, and figure constants in dm.SW, dm.DW. See Design Philosophy for the architecture behind these choices.

../_images/evolution_step1.svg ../_images/evolution_step2.svg ../_images/evolution_step3.svg ../_images/evolution_step4.svg