
Making figures for papers always took me longer than it should have. Often it was not the hard figure with the interesting result, but a plain bar chart.
You add the value on top of each bar, and the numbers overlap or sit in the wrong place. You rotate the tick labels, try 30°, then 45°, then 60°, and every angle looks a bit silly. Adjusting the spacing between groups of bars was so fiddly that I never really did it. The figure ended up as “good enough”, which is a phrase nobody wants to read in a review.
This post is about how that changed for me, and about paper-skills, the two agent skills I wrote so I don’t have to explain the same things to a coding agent in every project. It is written for researchers, PhD students and especially students working on a thesis who are wondering how AI could help with it.
Figures used to be a search problem
For a long time, making a figure in Matplotlib meant searching documentation and forum threads for the one keyword argument that moves a label by three points. Code completion in VS Code, two or three years ago, made the typing faster. It did not answer the question that matters: does this look right on the page?
Over the years I settled on a few habits that I would still recommend without any AI involved:
- One script per figure, saved where you will find it again in six months. Rerunning one figure should not mean rerunning a notebook from the top.
- Shared defaults for sizes, fonts and colours. Setting them once pays off as soon as you have more than three figures that should look like they belong to the same paper.
- SVG instead of PGF. Matplotlib can export PGF so that LaTeX typesets the labels, but I don’t like that approach. You only see the font sizes once the paper compiles, figures usually need a smaller font than the body text anyway, and mathematical symbols are fiddly. Worst of all, LaTeX redraws every PGF plot on every build, even though the figure has not changed. In a thesis full of detailed plots, that meant waiting ages for each compile, and sometimes the compiler simply gave up. An SVG written once by Python is a vector graphic, zoomable and small, and it also drops straight into PowerPoint or onto a web page.
From autocomplete to agents
Last year I started to use coding agents for figures. That helped, but I stayed in the loop as the agent’s eyes: it changed the code, I opened the PNG, described what was wrong, and we went around again. I was the slowest part of that loop.
About two months ago I tried something obvious in hindsight. I let Claude render the figure and look at it itself. Current models can read images, so the agent can notice that the legend covers the data or that two labels collide, fix the generator and rerun it before I ever see a version. Suddenly I got clean figures that fit the format and style of the paper within minutes. For my own work, that was a big change.
Why I turned it into skills
Little in a PhD repeats exactly. Every project brings new models, new data and new questions. Figures and tables are the exception: every paper needs them, and the rules for good ones are always the same.
That is what agent skills are for. A skill is a short set of instructions, plus any helper code, that a coding agent loads when a task matches it. Instead of explaining my conventions at the start of every session, I wrote them down once.
Tables got the same treatment, for a less aesthetic reason. A number that you type into a LaTeX tabular by hand is correct exactly until the next time you rerun the analysis. After that it silently disagrees with your data, and nothing tells you. For scientific consistency, every table should come from a script.
What paper-skills does
The core idea is simple: every figure and every table comes from its own Python generator, and the generators share one small kit for sizes, colours and saving. The output goes into the figure or table folder of the paper, and next to each file sits a short shell script that reruns its generator. Six months later, “how did I make this?” has an answer.
On top of that, the kit takes care of the things I used to get wrong:
- Measured sizes. The kit measures the text block of your paper and makes each figure exactly as wide as it will be printed. LaTeX does not rescale it, so a 7 pt label stays 7 pt.
- Vector graphics. Python writes SVG, and Inkscape converts it during the LaTeX build. The labels are stored as outlines, so the figure does not depend on installed fonts.
- Reproducible files. Rerunning a generator on unchanged data produces a byte-identical SVG. If Git shows a changed figure, the figure really changed. That matters for you, and even more for an agent, which uses exactly this to notice what its last edit did.
- Consistent colours. A colour-blind-safe palette, plus fixed colours for lines with a meaning: reference, model, setpoint, baseline and limit look the same in every figure.
- The agent looks at its own output. After each run, the agent opens the PNG and checks it against a short list: every label readable and not overlapping, the legend not covering data, every series distinguishable, the point of the figure visible. For tables, it checks that nothing wraps into the next column, units sit in the headings and precision is consistent within a column. Then it fixes the generator and reruns it until the list is clear.
- A page-fit check in seconds. The kit compiles a single figure or table with your paper’s preamble and reports whether it shares a page with text, gets a float page or is pushed back to the end of the document. You don’t need to build the whole paper to find out.
- Three separate texts. The running text gets one or two lines on what the figure shows. The caption gets two sentences. Details, measured numbers and caveats go into a comment block above the figure, stamped with the date and Git commit. This keeps the agent from writing analysis paragraphs into your paper, because the prose belongs to the author.
A word on Git, because the whole approach leans on it: track your scientific work in a Git repository, the paper included. You can undo a change that turned out to be wrong, compare today’s figure with last month’s, and see exactly which commit produced the numbers in a table. It also makes collaboration easier: you can see exactly what a co-author contributed, and compare how the paper changed between any two versions. That is also why the kit writes SVG and no PDF by default. SVG is text, so the repository stays small and the history stays readable. The PNGs exist so that the agent can look at the figures. If you want to save even more space, you can put them into .gitignore. And if you do need PDFs, for a journal or a co-author, add "pdf" to the list of output formats in paper_kit.toml.
Installing it is a single prompt to your coding agent, run from the root of your paper project:
Install the paper skills from https://github.com/juliusaka/paper-skills into this project. Follow SETUP.md in that repository.
You need Python 3.11 or newer, a LaTeX distribution with pdflatex, and Inkscape. The page checks compile with pdfLaTeX, so papers that need XeLaTeX or LuaLaTeX are not supported yet. The full list is in the README. You also need a model that can read images, otherwise the self-review step does not work. I use Claude Opus 5.5 in Claude Code in the terminal. For simple figures, Sonnet is probably enough.
Does it matter how a figure was made?
I don’t think so. For scientific progress, what matters is that a figure is logically correct and shows what the data supports, not whether a person or an agent nudged the tick labels into place. You are still responsible for every number and every claim.
What automation changes is the time budget. When a figure takes ten minutes instead of an afternoon, you can afford to look at more details: another slice of the data, a second comparison, a sanity check you would otherwise have skipped.
The risks
There is a downside, and I have not solved it for myself. With an agent that turns every idea into a finished figure in minutes, it is very easy to get lost. I call it intent drift: you start with a clear question, follow one interesting detail, then another, and two hours later you have a beautiful figure of a very specific analysis that does not help the paper.
Steering an agent well takes concentration. Before a session, I now ask myself honestly whether I am rested enough to keep it on track. What helps me:
- Write the goal down first, ideally by hand on paper, where the agent can’t edit it.
- Plan a fixed amount of time per figure. When it runs out, either the figure is good enough or the question was not clear.
- Start new sessions regularly. A fresh session starts without the detours of the last two hours.
- Don’t iterate forever. If the fifth round of changes is not clearly better than the fourth, stop.
- At the end, ask the agent what the figure is for. Compare its answer with the goal you wrote down. If they differ, the figure has drifted, and so maybe have you.
Don’t just talk to the agent. Look at the data. It is tempting to let the agent load the data, analyse it and hand you a tidy summary, which in effect means handing over your own job. But summaries hide exactly what your experience would catch. If you compute errors over segments of a dataset, one segment may sit far away from all the others, and no single aggregated number will tell you. So every now and then, dump the raw data and open it in Excel, or plot every simulated trajectory on its own. With what you know from your degree or your engineering work, you will often see within minutes what is going on. Otherwise you can end up designing a sophisticated analysis concept together with the agent, only to watch it dissolve once you notice the simple reason why everything got so complicated in the first place. Three days of methodology, defeated by one look at column F.
One more practical point: run the agent in a sandbox and give it access only to the files and folders it needs. An agent that reads files and web pages can be manipulated by text hidden in them, a risk known as prompt injection, and research projects often contain unpublished or confidential data that should not leave your machine.
Still learning
I am still learning how to work well like this, and I would rather say so openly than present a finished method. The skills encode what has worked for me so far. Some of it will turn out to be wrong, and there are open points, such as making line series reliably distinct when printed in greyscale.
If you try paper-skills for your paper or thesis, I would like to hear what worked and what didn’t. Open an issue on GitHub or write me an email.
© 2026 Julius Aka. All rights reserved. Impressum