scienceplot-pylisted
Install: claude install-skill Axect/skills
# scienceplot-py — Matplotlib Script Generator (scienceplots / science+nature)
Generate a Python plotting script that **always** follows the user's lab
template shape. The skill writes a `.py` file and returns its path; it does
not run the script. The user executes it themselves (the user prefers
`uv run <path>` per their global preferences).
The canonical template lives at
`~/Socialst/Templates/PyPlot_Template/pq_plot.py`. Every variant in this
skill is a structural extension of that file.
## Mandatory style invariants
Every generated script MUST keep these load-bearing patterns intact. Do not
"clean up" any of them, even if they look redundant or unused.
1. **`import scienceplots`** — required. It registers the `science` and
`nature` styles by import side-effect; the symbol is never referenced
directly. Linters will flag it as unused — keep it anyway.
2. **Style context block** — all plotting code lives inside
`with plt.style.context(["science", "nature"]):`. Never substitute
`plt.style.use(...)` or call any plotting outside this block.
3. **`pparam` dict** — axis configuration is a dict, applied with
`ax.set(**pparam)`. Do not inline `ax.set_xlabel(...)`, `set_ylabel(...)`,
`set_title(...)` calls when `pparam` would do.
4. **`ax.autoscale(tight=True)`** — called on every axis, before
`ax.set(**pparam)`. For subplots, loop over all axes.
5. **Raw-string LaTeX** — every label, title, legend entry uses `r'...'`.
Non-raw `'$x$'` works for the liter