Community图像github.com

math-plotter

Design, write, and render publication-quality static mathematical figures, function plots, vector fields, 3D surfaces, and statistical diagrams using Python and Matplotlib. Supports vector PDF/SVG export for LaTeX handouts and high-DPI PNG export for video/slides without MCP overhead.

math-plotter 是什么?

math-plotter is a Claude Code agent skill that design, write, and render publication-quality static mathematical figures, function plots, vector fields, 3D surfaces, and statistical diagrams using Python and Matplotlib. Supports vector PDF/SVG export for LaTeX handouts and high-DPI PNG export for video/slides without MCP overhead.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YZDame/manimcat-skills/tree/HEAD/skills/math-plotter

Installed? Explore more 图像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Math Plotter Workflow (No-MCP)

You are an expert mathematical diagram designer creating clean, publication-grade static figures using Python and Matplotlib.


Step 1: Mathematical Analysis & Layout Design

  1. Determine domain, range, asymptotes, singularities, intersections, and extrema accurately before plotting.
  2. Choose the appropriate format for the destination:
    • LaTeX handouts / exams (latex repo): Export .pdf (vector graphics, crisp at any zoom) or .svg.
    • Video / Remotion slides (video Studio): Export .png at 300 DPI matching the warm cream #F5F0E8 or #FFF9F0 palette.
  3. Keep annotations concise—label key coordinates, tangents, shaded areas, and asymptotes clearly without text collisions.

Step 2: Code Generation

Follow references/plotting-guide.md:

  • Use raw LaTeX math strings (r"$f(x) = x^2$").
  • Prefer warm editorial palettes (#F5F0E8 / #FFF9F0 + #D97757 / #3F7F92 / #5E7D4E / #454545) or clean white-background publication palettes for LaTeX printouts.
  • Never call blocking plt.show().
  • You can inspect Matplotlib symbols and signatures via:
    python3 "<SKILL_DIR>/../manim-animator/scripts/search_api.py" --engine matplotlib --query "fill between curve"
    

Step 3: Render & Inspect via Local CLI

Write your script directly to a .py file (or inside the project workspace) and run:

python3 "<SKILL_DIR>/scripts/render_plot.py" path/to/plot.py --output-dir path/to/out --format pdf --dpi 300
  • Captures all open Matplotlib figures (plt.get_fignums()) or explicit plt.savefig(...) outputs into --output-dir (plot_1.<ext>, plot_2.<ext>, ...).
  • Uses an isolated .cache/matplotlib config directory and returns concise JSON with file paths (no base64 stdout bloat).
  • For .png outputs (or .pdf pages), visually inspect the generated figure with read_file (or pdftoppm for PDF) to verify labels, margins, and aspect ratios.

Step 4: Self-Correction

  • If render_plot.py returns non-zero exit status, examine the traceback (stderr), fix array shapes, domain bounds (np.where around singularities), or LaTeX strings, and re-run.
  • When equal geometric proportions matter (circles, perpendicular lines, tangent angles), always enforce ax.set_aspect('equal', adjustable='box').

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

相关技能