Designed for AI Agents¶
AI coding agents — Cursor, Copilot, Claude, and other LLM-powered assistants — already know matplotlib. It is one of the most heavily represented Python libraries in any LLM’s training data, with 40M+ monthly PyPI downloads and 70k+ Stack Overflow questions.
dartwork-mpl is built to leverage this fact. This page explains the design principles behind our AI-friendly API. For concrete features and setup instructions, see the AI Integration guide.
One Right Way to Do Things¶
The most common source of AI errors is ambiguity. When there are multiple ways to achieve the same result, LLMs pick different approaches across conversations — leading to inconsistent output.
dartwork-mpl provides one canonical function for each task:
Task |
Raw matplotlib (many ways) |
dartwork-mpl (one way) |
|---|---|---|
Apply a style |
|
|
Set layout |
|
|
Save figures |
|
|
Set font size |
|
|
Semantic Color Names¶
AI assistants are unreliable with hex codes. Ask for “a nice blue” and you’ll get a different #hex every time.
dartwork-mpl solves this with human-readable, deterministic color names:
# AI can describe and produce these reliably
ax.plot(x, y1, color='oc.red5') # OpenColor red, weight 5
ax.plot(x, y2, color='tw.blue500') # Tailwind blue 500
# Compare with raw matplotlib
ax.plot(x, y1, color='#e03131') # What color is this? 🤷
Context Prompts over Predefined Functions¶
Instead of memorizing specialized plot functions, describe what you want in plain language:
"Create a line plot for a Korean research paper with two y-axes,
use dartwork-mpl's scientific-kr style, and optimize the layout"
The agent generates correct code because the underlying matplotlib API is well-known, and dartwork-mpl’s utilities (dm.style.use, dm.simple_layout) are simple and predictable.
Built-in Knowledge Base¶
dartwork-mpl bundles its documentation inside the package, accessible even in air-gapped environments:
dm.list_prompts() # ['general-guide', 'layout-guide']
content = dm.get_prompt('general-guide') # read guide programmatically
For real-time access, dartwork-mpl also ships a Model Context Protocol (MCP) server — see AI Integration for setup.
See also¶
Why AI-Ready? — concrete features: validation, MCP, and a worked example
MCP Server — step-by-step setup
AI-Assisted Development — IDE integration and bundled guides