xkcd-py
Skill4 starsChanged 20 days agoMITView on GitHub
Generate a Python matplotlib plot script following the user's mandatory xkcd style — `with plt.xkcd():` context, `pparam = dict(...)` axis-config, raw-string LaTeX labels, wide canvas (`figsize=(10, 6)`), `dpi=300` savefig. Supports parquet / CSV / NumPy (`.npy`, `.npz`) and four variants: single line, multi-line + legend, scatter / errorbar, multi-panel subplots. Writes the `.py` only — does NOT execute it; the user runs it (typically `uv run`). Use when asked to write an xkcd-style / hand-drawn / sketch-style matplotlib script, plot data in xkcd style from parquet / CSV / `.npy`, scaffold an xkcd line / scatter / errorbar / subplot script, or match the lab's xkcd template. Triggers on: xkcd plot, xkcd matplotlib, xkcd style, hand-drawn / sketch plot, plt.xkcd, comic-style plot; xkcd 플롯, xkcd 그래프, 손그림 그래프, 스케치 스타일 플롯, xkcd 스크립트, xkcd 코드.
In this repository38 other files it gives its agents.
- academic-cvSkill
- academic-jobsSkill
- academic-proseSkill
- adversarial-reviewSkill
- bibtex-genSkill
- chrome-sessionSkill
- clickup-cliSkill
- clickup-todaySkill
- commit-triageSkill
- concept-explainerSkill
- contact-emailSkill
- cover-letterSkill
- dropboxSkill
- handdrawn-schematicSkill
- hep-rumor-millSkill
- journal-club-reviewSkill
- magi-researchSkill
- md2pdf-typoraSkill
- morgenSkill
- overleaf-section-workflowSkill
- overleapSkill
- peer-agent-reviewSkill
- proton-mailSkill
- reference-searchSkill
- remarkable-syncSkill
- research-backupSkill
- research-boardSkill
- research-logSkill
- research-portalSkill
- research-proposalSkill
- research-reportSkill
- research-statementSkill
- scienceplot-pySkill
- vastaiSkill
- wide-slide-illustratorSkill
- workshop-paper-reviewSkill
- zai-web-searchSkill
- zoom-summarySkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Every generated script MUST keep these load-bearing patterns intact.
- Very specific: line 52
Default filename is plot.png.
- Very specific: line 83
Write the .py file with the Write tool.
- Very specific: line 85
Do not invoke uv / python from this skill.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
xkcd-py — Matplotlib Script Generator (xkcd / hand-drawn style)
Generate a Python plotting script that always follows the user's lab
xkcd template. The skill writes a .py file and returns its path; it does
not run the script. The user executes it themselves (preferred:
uv run <path> per their global preferences).
The canonical template lives at
~/Socialst/Templates/PyPlot_Template/xkcd_plot.py. Every variant in this
skill is a structural extension of that file, normalized to the same
pparam + ax-object pattern as scienceplot-py.
Mandatory style invariants
Every generated script MUST keep these load-bearing patterns intact. Do not "clean up" any of them.
- xkcd context block — all plotting (and
savefig) lives insidewith plt.xkcd():. Never substituteplt.rcParams.update(...)or call any plotting outside this block; once thewithexits, rcParams are restored and a latersavefigwill lose the xkcd fonts. pparamdict — axis configuration is a dict, applied withax.set(**pparam). Do not inlineax.set_xlabel(...),set_ylabel(...),set_title(...)calls whenpparamwould do.ax.autoscale(tight=True)— called on every axis, beforeax.set(**pparam). For subplots, loop over all axes.- Raw-string LaTeX — every label, title, legend entry uses
r'...'. xkcd uses matplotlib'smathtextfor$...$blocks (not real LaTeX); raw strings still matter the moment a backslash appears. - figsize
(10, 6)— xkcd-style figures need a wider canvas than the matplotlib default for the hand-drawn font and stroke widths to read cleanly. Passfigsize=(10, 6)toplt.subplots(...). For subplots (rows × cols), scale proportionally. - savefig —
fig.savefig(<path>, dpi=300, bbox_inches='tight'). Default filename isplot.png. DPI is 300 (not 600). xkcd plots are deliberately sketchy; 600 dpi adds no value and bloats the file.
Font note
xkcd uses Humor Sans / xkcd-Script / Comic Neue. If none are installed,
matplotlib falls back to Bitstream Vera Sans and emits a findfont:
Font family ['xkcd Script', ...] not found warning. The plot still
renders — the warning is informational. Do not try to suppress it; do not
install fonts as part of the skill.
Workflow
- Gather what the user has not already given:
- Data source: parquet / CSV /
.npy/.npz, plus the file path - x / y column or array names (and y-error if errorbar)
- Plot variant: single line, multi-line + legend, scatter / errorbar, or subplots (rows × cols)
- Axis labels, title, legend labels (LaTeX OK — strings will be wrapped in raw-string form)
- Output path (default:
plot.pngnext to the data file or in cwd)
- Data source: parquet / CSV /
- Pick the matching template under
references/:single_line.py— one series, one ax (mirrorsxkcd_plot.py)multi_line.py— multiple series, one ax, with legendscatter_errorbar.py—ax.errorbar(...)(orax.scatter(...))subplots.py— multi-panelfig, axes = plt.subplots(rows, cols)
- Swap in the requested data-loader block. See
references/data_loaders.mdfor parquet / CSV /.npy/.npzsnippets. - Substitute column names, label strings, title, output filename. Preserve every invariant from the section above.
- Write the
.pyfile with the Write tool. Do not execute it. - Print the output path and a one-line "run with
uv run <path>" hint. Do not invokeuv/pythonfrom this skill.
Data sources
| Source | Imports | Read call |
| Parquet | import pandas as pd | df = pd.read_parquet('data.parquet') |
| CSV | import pandas as pd | df = pd.read_csv('data.csv') |
NumPy .npy | import numpy as np | data = np.load('data.npy') (then column-slice) |
NumPy .npz | import numpy as np | data = np.load('data.npz'); x = data['x'] |
Full snippets in references/data_loaders.md.
Templates
| Variant | File |
| Single line (base) | references/single_line.py |
| Multi-line + legend | references/multi_line.py |
| Scatter / errorbar | references/scatter_errorbar.py |
| Subplots (multi-panel) | references/subplots.py |
| Data loaders | references/data_loaders.md |
What this skill does NOT do
- It does not run the generated script. The user runs it (preferred:
uv run <path>). - It does not install matplotlib / pandas / numpy or any xkcd font.
- It does not produce publication-quality
science+natureplots — for those, use thescienceplot-pyskill. - It does not change the style invariants. If the user asks for
publication-style or different DPI, suggest
scienceplot-pyinstead of bending xkcd-py's invariants.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

