Skip to content

hanlulong/matlab-plot-skill

Repository files navigation

Publication-Quality MATLAB Figures

matlab-plot-skill is a reusable skill for Codex and Claude Code that fixes messy MATLAB figures: cramped layouts, unreadable titles, awkward legends, bad white space, and weak PDF output for LaTeX or Overleaf.

The key rule is simple: the agent must not stop after writing plotting code. It must generate the figure, export it, read the rendered figure itself, and iterate until the visual result is no longer a mess.

Demo figure

Find This Repo If You Searched For

  • how to make MATLAB figures look professional
  • publication-quality MATLAB plots
  • fix messy subplot layout in MATLAB
  • export MATLAB figure to PDF for LaTeX
  • MATLAB figures for Overleaf
  • improve MATLAB legend, title, spacing, and white space

What Problem This Solves

  • multi-panel MATLAB figures that look cramped or amateurish
  • legends that steal too much plot area
  • titles that are too long or too small after PDF scaling
  • inconsistent colors and symbols across panels
  • plots that look acceptable in MATLAB but bad once embedded in a paper

What This Skill Enforces

  • MATLAB-first figure cleanup for papers, appendices, and slides
  • vector PDF export for LaTeX and Overleaf workflows
  • better layout choices for multi-panel figures
  • explicit render-review-iterate behavior
  • reusable MATLAB export helper code
  • a quick PNG review path so the agent can read the rendered figure easily

Repository Layout

Install

Windows PowerShell

Install into both Codex and Claude Code skill directories:

.\install.ps1

Install only into Codex:

.\install.ps1 -Target codex

Overwrite an existing installed copy:

.\install.ps1 -Force

macOS / Linux

./install.sh

Install only into Claude Code:

./install.sh --target claude

Manual Install

Copy the matlab-plot-skill folder into one or both of these locations:

  • Codex: ~/.codex/skills/matlab-plot-skill
  • Claude Code: ~/.claude/skills/matlab-plot-skill

Example Invocation

Use prompts like:

Use $matlab-plot-skill to refactor Plots/generate_my_figure.m into a publication-quality PDF figure. Read the exported figure and the compiled paper page, then iterate until the spacing and titles are clean.
Use $matlab-plot-skill to improve this MATLAB appendix figure. Keep the color mapping fixed across panels, distinguish variants with markers, export a vector PDF, and read the generated figure yourself before stopping.

Demo Example

Run:

matlab -batch "run('examples/demo_publication_figure.m')"

This generates:

  • examples/output/demo_publication_figure.pdf
  • examples/output/demo_publication_figure.png

The PNG is there for fast review. The PDF is the publication-style export for the paper workflow.

Validation

Run the repo validation locally:

uv run --with pyyaml python tools\validate_repo.py .

This checks:

  • required skill packaging files
  • SKILL.md front matter and workflow language
  • openai.yaml skill metadata
  • PowerShell install flow
  • bash install flow when bash is available

Notes

  • Codex reads agents/openai.yaml for optional UI metadata.
  • Claude Code can use the same SKILL.md-based folder structure.

About

Fix messy MATLAB figures: publication-quality plots, clean subplot layouts, and PDF export for LaTeX/Overleaf in Codex and Claude Code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors