Fignimble

Fignimble assembles multi-panel figures for publication, and conference posters, the part of Illustrator scientists actually use, with Python
underneath everything. Each figure is a short Python file that places panels, pictures, text and arrows; each panel
is drawn by matplotlib code. You edit a figure on the canvas (drag, resize, align, retype), in the code pane, or by
asking a coding agent (Claude Code, Codex, Gemini CLI) in Fignimble's terminal. All three change the same files, and
Fignimble re-renders as they change. A poster is a figure too: it places the paper's figures whole, drawn from
their code, so it changes when they do.
User guide: pachterlab.github.io/Fignimble
Fignimble is built on Manimble: the engine/app split, the JSON-lines
protocol, the undo model that coexists with an agent's edits, the terminal drawer and the agent instruction files
come from there.

A figure is Python
from fignimble import *
from style import STYLE # shared by every figure of the paper
fig = Figure(width=183, height=118, style=STYLE) # millimetres; 183 mm = Nature double column
fig.panel("panels/expression.py", x=4, y=3, w=56, h=52) # labelled a
fig.panel("panels/scatter.py", x=65, y=3, w=56, h=52) # labelled b
fig.image("images/cells.png", x=4, y=63, w=52) # pictures are panels too; h follows aspect
fig.image("images/schematic.svg", x=65, y=63, w=56, h=47) # PDF and SVG stay vector
fig.panel("panels/expression.py", x=129, y=63, w=53, h=50, function="bars")
fig.text("Treated", x=30, y=104, size=7, weight="bold", align="center")
fig.arrow(57, 82, 64, 82, width=0.6)
fig.bracket(147, 169, 67, text="**") # significance bracket
A panel file is matplotlib code that draws into a figure of exactly the panel's size:
def draw(fig, genes=("GAPDH", "CD3E")):
ax = fig.add_subplot()
...
A project is a folder, by convention fignimble/ in the paper's repository: a fignimble.toml at its top (which
marks it, and the Fignimble version that made it), style.py, the figure files, and panels/, images/ and data/.
Coordinates are millimetres from the top-left corner, y down, as in Illustrator. One call per element, with literal
numbers, so that moving something on the canvas is a one-number change to its line of code.
Panels can use any package (pandas, seaborn, statsmodels...). List the ones beyond matplotlib and NumPy in the
project's requirements.txt and Fignimble offers to install them into its Python when the project opens (Fignimble ▸
Check Packages… asks again). Slow work that several panels share, like loading data or fitting a model, goes in a
function marked @cached("data/table.csv"): it runs once and is kept until its code, its arguments or that file
changes.
Patchwork-style layouts
Panels can also be laid out the way patchwork composes ggplots, instead of
(or alongside) placing them by hand:
expression, counts = Panel("panels/expression.py"), Panel("panels/counts.py")
heatmap, bars = Panel("panels/heatmap.py"), Panel("panels/expression.py", function="bars")
fig.layout((expression | counts) / (bars | heatmap), x=4, y=3, w=177, h=104, heights=[2, 1]) # | beside, / below
fig.layout(Grid(expression, counts, bars, heatmap, ncol=2), x=4, y=3, w=177, h=104) # + wraps into a grid
fig.layout(Design("""
AAC
BDC
""", A=expression, B=bars, C=heatmap, D=counts), x=4, y=3, w=177, h=104, widths=[1, 1, 1.2],
guides="collect", legend="bottom") # one shared legend
fig.inset(Panel("panels/counts.py", function="zoom"), within=counts, x=0.55, y=0.08, w=0.4, h=0.35)