dartwork-mpl

matplotlib, but beautiful.

Publication-quality plots with zero learning curve — built for AI coding agents.

uv add git+https://github.com/dartworklabs/dartwork-mpl
Get Started → AI / Agents →

Built for AI-assisted plotting

Most matplotlib code in 2026 is written through an agent — Cursor, Claude Code, Continue, Windsurf, Zed Agent panel, Aider — not by typing into a blank notebook. dartwork-mpl is the first design layer on top of matplotlib that is built for that workflow: every API is unambiguous, every color and width has a name (not a hex or a float), the bundled MCP server lets agents read the docs live, and a lint engine catches the patterns LLMs typically get wrong.

🔌 MCP-native

One JSON snippet wires dartwork-mpl-mcp into Claude Code, Cursor, Windsurf, Continue, or Zed. The agent gets live docs, anti-pattern lint, color lookup, and plot templates — inside the chat context.

pip install "dartwork-mpl[mcp]"
AI & Agent-Assisted Plotting
📄 Works with every other agent too

No MCP? llms.txt (2.5 KB index) and llms-full.txt (45 KB full reference) drop straight into Aider, Copilot Chat, ChatGPT, or Claude.ai. Resolve them from Python with dm.agent_doc_path("llms-full") / dm.get_agent_doc("llms-full").

See the IDE compatibility matrix

AI & Agent-Assisted Plotting

Drag the slider — same data, two worlds

default mpl dartwork-mpl
default matplotlib
dartwork-mpl styled

Six rcParam shifts make the difference:

font.family DejaVu SansRoboto
font.weight normal (400)light (300)
axes.spines box (4 sides)top & right hidden, thinner
lines.linewidth 1.5 pt1.0 pt
layout tight_layout()dm.simple_layout(fig, margin="2mm")
prop_cycle C0..C9 (saturated)dc.0..dc.9 (curated mood)

Drag the divider to inspect the seam. The left half is what plt.savefig() writes with default rcParams; the right half is the same script plus two dartwork-mpl calls — dm.style.use("scientific") to swap the rcParams listed below the slider, and dm.simple_layout(fig) to handle margins. No new plotting API, no axes wrappers, no opinions about your data. Just the typography and layout knobs you would have set yourself if you had the budget.

Quick Example

import matplotlib.pyplot as plt
import dartwork_mpl as dm

dm.style.use("scientific")              # Pick a style
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 4, 2])           # Regular matplotlib
dm.simple_layout(fig)                   # Better layout
dm.save_formats(fig, "output")          # Export SVG + PNG
Scientific-style line chart created with dartwork-mpl

What’s in the box

Style presets

Seven curated themes — scientific, report, presentation, poster, web, dark, minimal — each one tunes fonts, line weights, spines, and ticks in a single dm.style.use(...) call.

Styles and Presets
Deterministic layout

dm.simple_layout(fig) measures every visible artist and snaps the axes to consistent margins — twinx, colorbars, rotated ticks, and long Korean labels included. No bbox_inches="tight" guessing.

Layout and Typography
900+ named colors

Open Color, Tailwind, Material, Ant Design, Chakra, and Primer shipped as plain color strings — color="dc.ocean2" works anywhere matplotlib accepts a color. Plus 30+ perceptually-uniform colormaps.

Color System
Validation before you ship

dm.validate_figure(fig) flags overflow, asymmetric margins, and pie-label cutoffs before you save. validate_with_fixes patches the obvious ones for you.

Save and Validation
Zero API changes

dartwork-mpl never wraps Figure or Axes. It sets up the environment and stays out of your way, so every matplotlib trick you already know still works.

Design Philosophy
One-line export

dm.save_formats(fig, "out", formats=("png", "svg", "pdf")) writes all three at the right DPI in a single call — with an optional validate=True to catch problems before they ship.

Save & Export