dartwork-mpl은 matplotlib의 Figure·Axes를 그대로 두고, matplotlib에서 번거로운 부분만 채웁니다. 물리 폭 기준 크기 API, 다듬은 스타일 프리셋, OKLCH 기반 색 체계, 결정적인 여백 배치, 그림 검증, 그리고 AI 코딩 도구용 MCP 서버입니다. 새 그리기 API를 배울 필요 없이 matplotlib를 그대로 쓰면 됩니다.

설치
pip install dartwork-mpl # 또는: uv add dartwork-mpl Python 3.10 이상. 추가 기능: [notebook] 주피터 인라인 표시, [mcp] AI 도구용 서버, [ui] 대화형 파라미터 뷰어.
쓰는 법 전부
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 프리셋 → figsize(폭, 비율) → simple_layout → save_formats. tight_layout()도, 손으로 맞추는 figsize=(w, h) 계산도, dpi= 어림도 필요 없습니다.
특징
- 인치에서 벗어난 크기 —
dm.figsize("13cm", "standard")처럼 물리 폭과 비율만 주면 높이가 정해집니다. - 결정적인 배치 —
simple_layout(fig)이 보이는 요소를 모두 재고 격자를 계산으로 배치합니다. 어느 컴퓨터에서나 같은 결과입니다. - OKLCH 색 — 이름 붙은 팔레트와, OKLab·OKLCH·RGB를 오가며 지각적으로 보간하는
Color클래스. - 다듬은 스타일 —
scientific·report·presentation등 프리셋 7종, 각각 한국어-kr변형 포함. - 검증과 내보내기 —
validate_figure(fig)가 넘침·겹침·눈금 혼잡을 잡고,save_formats가 SVG·PNG·PDF·EPS를 한 번에 씁니다. - AI 친화 — 함께 들어 있는 MCP 서버로 Claude Code·Cursor·Windsurf가 린트·자동 수정, 그림 검증, 색 조회를 씁니다.