dartwork-mpl keeps matplotlib’s Figure and Axes fully native and adds the parts matplotlib makes tedious: a physical-width geometry API, curated style presets, an OKLCH-aware color system, deterministic content-aware layout, visual validation, and an MCP server for AI coding assistants. You keep writing matplotlib — just without the friction.

Installation
pip install dartwork-mpl # or: uv add dartwork-mpl Requires Python 3.10+. Extras: [notebook] for inline display in Jupyter, [mcp] for the AI-assistant server, [ui] for the interactive parameter viewer.
The whole workflow
import matplotlib.pyplot as plt
import dartwork_mpl as dm
dm.style.use("scientific") # 1. curated preset
fig, ax = plt.subplots(figsize=dm.figsize("13cm", "standard")) # 2. physical width × aspect
ax.plot(x, y, color="oc.blue5", lw=dm.lw(0))
dm.simple_layout(fig) # 3. content-aware margins
dm.save_formats(fig, "figure", formats=("svg", "png", "pdf")) # 4. multi-format save Preset → figsize(width, aspect) → simple_layout → save_formats. No tight_layout(), no hand-tuned figsize=(w, h) arithmetic, no dpi= guesswork.
Highlights
- Geometry, decoupled from inches —
dm.figsize("13cm", "standard")takes a physical width and an aspect token; the height follows. - Deterministic layout —
simple_layout(fig)measures every visible artist and places the grid arithmetically, reproducible across machines. - OKLCH-aware color — named palettes plus a
Colorclass spanning OKLab / OKLCH / RGB with perceptual interpolation. - Curated styling — seven presets (
scientific,report,presentation, …), each with a Korean-krvariant. - Validation & export —
validate_figure(fig)flags overflow, overlap, and tick crowding;save_formatswrites SVG / PNG / PDF / EPS at once. - AI-native — a bundled MCP server gives Claude Code, Cursor, and Windsurf lint and auto-fix, figure validation, and color lookup.