Skip to content
| Marketplace
Sign in
Visual Studio Code>Data Science>panelistNew to Visual Studio Code? Get it now.
panelist

panelist

costantinoai

|
3 installs
| (0) | Free
Lay out multi-panel matplotlib figures on a canvas: move, resize and align panels in millimetres, set text styles and the look, export. Your plotting script is never edited.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

panelist

Arrange multi-panel matplotlib figures with the mouse. Keep the arrangement in a layout file. Publish with plain matplotlib.

Python 3.10+ matplotlib 3.10–3.11 Status 0.1 License MIT

Why · How it works · Features · Screenshots · Install · Usage · Related projects

panelist in action: an untidy figure is put into a layout grid, a second grid is attached below for an image panel, a legend is moved off the data, a journal text style is applied, and both grids are squeezed to their panels

An arrow and a text box are drawn, a plot is cropped, and the page is set to Nature's single column: the grid is rearranged into one column
Annotate, crop, fit a journal's column: an arrow and a text box, a crop, then Nature's 89 mm page, explained and previewed first.
The figure is despined and recoloured, one panel gets its own colours, and the script is rerun on new data with the same layout
The figure's look: despine, a palette, lines and ticks, one panel's own colours; then new data, the same layout and look.

Why panelist

A figure for a paper is usually several plots on one page. Each plot comes from code, but the page has its own rules: the journal's column width in millimetres, axes that line up, equal gaps, the same font size for every tick label, a bold letter on each panel.

In matplotlib today there are two ways to get there, and both are slow:

  • Guess numbers in code. Tune fig.add_axes, gridspec ratios and subplots_adjust, rerun the script, look, and guess again.
  • Fix the export by hand. Open the PDF in Illustrator or Inkscape and move things around. Every time the data change, the figure is regenerated and the manual work starts over.

panelist lets you place the panels by eye on the rendered figure, saves the result as data, and replays it on every run of your script.

How it works

  1. Open the figure your script already draws in the panelist editor.
  2. Arrange it on a millimetre page: move and align panels, put them in layout grids, and set the size, weight and font of every kind of text.
  3. Save. The arrangement is stored in a layout file next to your code (fig.layout.json).
  4. Compile. panelist turns the layout file into a small Python module (fig_layout.py) that imports only matplotlib and the standard library's warnings. It writes only over a module it generated earlier, never over your script or any other file.
  5. Apply it from your script with one call:
from fig_layout import apply_layout

apply_layout(fig, targets={"a": ax_a, "b": ax_b})
fig.savefig("fig.pdf")

When the data change, rerun the script and the layout comes back exactly as it was. Your plotting code is never edited, and the published figure does not need panelist installed.

Features

Everything below is stored in the layout file. Your script is never edited, and Reset gives back what it drew.

The page

Journal widths The page is in millimetres. One click sets the single, 1.5 or double column width of Nature, Elsevier or PLOS ONE (sizes read from their guides), or of your own preset.
A new page size, previewed When panels no longer fit, the grid is rearranged into fewer columns and the plots keep their size. Scaling the plots is offered only when that is not enough. You see what will change before anything moves.
Trim Trim the page to its content in one click.
Check for a journal Page width and depth, text too small or too big, fonts that are not installed, anything off the page. Each problem links to what to select.

Placing panels

Direct editing Drag panels, resize plots by their handles, nudge by 0.1 mm with the arrow keys. Edges, centres, plot frames and equal gaps snap, with guides.
Arrange and group Align, distribute with equal gaps, match widths or heights. Group panels and nest groups.
Layout grids Put panels into grid cells, drag grid lines, add rows or columns, attach a second grid to an edge. A grid never resizes a panel: a change that would not fit is refused, and the editor says why.
Panel, plot, element Double-click a panel to work on its plots, each with its colorbar and title. Double-click a plot to reach its single elements; Esc goes back.
Crop Crop a plot like a photo (C): it gets smaller at the same data scale. Log axes and images too.
In front, behind Bring a plot, a text, a legend or a shape to the front or send it back (Ctrl+] and Ctrl+[).

Text and annotations

Text styles Size, bold and italic for each kind of text (panel letters, titles, axis labels, tick labels, legends, annotations), and one font for all of it. A preset applies a journal's rules in one click.
Edit any text Double-click a title, an axis label or any figure text and type.
Colour and angle Colour any text; rotate a text or one axis's tick labels.
Panel letters One command adds a, b, c… in reading order, at each panel's top-left corner.
Shapes and text boxes Draw lines, arrows, boxes, ellipses and text boxes (L, A, R, O, T). They follow the panel they are drawn on.
Insets Connect a zoomed inset to the region it shows: a box and two lines that follow both plots.

How the plots look

Figure look Line, spine and tick widths, tick length and direction, despine, bar edges, and show or hide titles, axis labels, tick labels, legends, grid lines and colorbars. Set it for the whole figure, then override it for one panel.
Palettes matplotlib's and seaborn's palettes, grouped by kind, or colours you choose. A palette is stored as its colours, so the published figure needs neither seaborn nor panelist. Each series is recoloured everywhere it appears: lines, error bands, bars, points and legend keys.
Lines one by one Give any line its own colour, dash, width and marker; its legend key follows.
Ticks and limits Log or symmetric log axes, where ticks go, how numbers are written, labels on each side, minor ticks. Type a plot's axis limits.
Legends Set a legend's columns, frame, title and corner; drag it anywhere.

Output

Export Ctrl+E saves the figure as PDF, PNG, SVG or TIFF at the dpi you choose, from a fresh run of your script. Fonts stay text, as journals ask.
Strict, repeatable output apply_layout checks every binding before it changes anything: a renamed or missing panel raises an error and the figure is left untouched. The same layout always compiles to the same file.
Several layouts Keep several layouts of one figure, each its own file, and flip between the last two with Ctrl+Shift+L.

The editor

Two hosts The same canvas runs in a standalone window (panelist edit) and as a VS Code editor for *.layout.json.
Commands Ctrl+K opens a palette with every command and every panel by name, ? lists every shortcut, and right-click opens the arrange menu.
Fast feedback While you move one panel, only that panel is redrawn. Every edit can be undone. The inspector shows exact millimetre values.

Screenshots

The panelist editor on a four-panel figure
The editor: layers on the left, the figure on its millimetre page, the inspector on the right.
The Text styles panel with the Nature preset
Text styles (Alt+3): a journal preset, then any size, weight or font by kind of text.
Changing the page to Nature's single column: the change explained and previewed
A journal's column width in one click: what will change is explained and previewed before anything moves.
A plot cropped like a photo, with its crop marks
Crop (C): drag a plot's edge in; the plot gets smaller at the same data scale.
The palette picker: matplotlib and seaborn palettes grouped by kind
Palettes from matplotlib and seaborn, grouped by kind, reversed if you like, or your own colours.
The command palette
Ctrl+K opens the command palette, with every command and every panel by name.

Install

panelist needs Python 3.10 or later and matplotlib 3.10 or 3.11.

In VS Code: install the extension panelist (costantinoai.panelist-editor) from the Extensions view. You can also download panelist-editor-<version>.vsix from the latest release and install it with code --install-extension panelist-editor-<version>.vsix. The extension carries panelist itself, so there is nothing to install with pip. It draws your figure with the Python selected in VS Code (Python: Select Interpreter), which needs matplotlib and your own plotting code.

From a terminal: the panelist command and the standalone editor window come from PyPI.

pip install panelist              # the library and the panelist command
pip install "panelist[editor]"    # the same, plus the editor window (PySide6 with QtWebEngine)

Install it into the Python environment that runs your plotting code.

To work on panelist itself, install it from a clone of this repository:

pip install -e ".[editor]"
cd editor && npm ci && npm run build && cd ..   # build the canvas once (needs Node.js)

environment.yml is the tested conda environment with everything: mamba env create -f environment.yml.

Usage

1. Point panelist at your figure

Write an adapter: a small .py file with a build() function that draws the figure with your own code and returns it together with the objects the layout may move.

import matplotlib.pyplot as plt

def build():
    fig, (ax_a, ax_b) = plt.subplots(1, 2)
    ...                                         # your plotting code
    return fig, {"a": ax_a, "b": ax_b}

panelist inspect adapter.py lists everything in a figure that a layout can bind (Axes, figure texts, legends).

When your plotting code saves its figure itself, two helpers keep every adapter a few lines long (adapters run only in the editor, so they may import panelist; the published figure never does):

from panelist.adapters import capture, letter_by_size, targets_by_letter
from mypaper import figures, panels

def build():
    fig = capture(lambda: figures.fig3(), intercept=[(panels, "save")])   # runs your code, writes nothing
    return fig, targets_by_letter(fig, letter=letter_by_size(8))          # "a.ax00", "a.t_title", "head", "legend0"

capture holds every savefig (and any save function you name) and returns the figure; targets_by_letter names each plot, text and legend by the panel letter above-left of it, in drawing order, so the names stay put while your code does.

2. Edit, check, compile

panelist edit     fig.layout.json                # open the layout on the canvas
panelist validate fig.layout.json                # report every problem by JSON path
panelist apply    fig.layout.json adapter.py -o fig.png [--dpi 300]   # save through the generated code, fonts embedded
panelist compile  panelist-layouts/               # every figure of a project: small modules sharing one panelist_runtime.py
panelist compile  fig.layout.json                # write fig_layout.py next to the layout (fig.compact.layout.json: fig_compact_layout.py)
panelist styles                                  # list the style presets, built-in and your own
panelist styles new|check                        # start a preset file, check one (see below)

In VS Code these steps need no terminal. Right-click the figure script and choose "panelist: New layout for this figure script"; the layout opens on the canvas. "Save and compile" in the editor's Export section writes fig_layout.py beside the script.

3. Apply the layout in your script

Import the compiled module and call apply_layout once, as shown in How it works.

Your own style presets (a journal, a lab, a poster)

A preset is one JSON file: text styles by kind of text, the figure's look (line, spine and tick widths), journal page widths, or any mix. Its file name is its id. Your presets live in ~/.config/panelist/styles/ (or in the folders named by PANELIST_STYLES) and appear in the Text styles menu and the command palette the next time a layout is opened.

panelist styles new lab-poster                   # a starter file in your styles folder (never overwrites)
panelist styles new my-journal --from nature     # a copy of a preset to change; its source and dates are emptied
panelist styles check ~/.config/panelist/styles/lab-poster.json   # every mistake by its place in the file, and fonts not installed here
panelist styles                                  # every preset panelist sees, and any broken file

The starter names the schema ("$schema"), so VS Code and other JSON editors complete the keys and flag mistakes while you type. A full example:

{
 "name": "My journal",
 "description": "Arial 6-8 pt, thin lines",
 "source": "https://example.org/author-guide/figures",
 "checked": "2026-11-26",
 "roles": {
  "panel_letter": {"size": 8, "weight": "bold"},
  "title": {"size": 8, "weight": "bold", "family": ["Arial", "DejaVu Sans"]},
  "axis_label": {"size": 7, "family": ["Arial", "DejaVu Sans"]},
  "tick_label": {"size": 6, "family": ["Arial", "DejaVu Sans"]},
  "legend": {"size": 6, "family": ["Arial", "DejaVu Sans"]}
 },
 "look": {"line_width_pt": 0.75, "spine_width_pt": 0.5, "tick_width_pt": 0.5, "tick_length_pt": 2.5, "tick_direction": "out"},
 "page": {
  "widths_mm": {"Single column": 85, "Double column": 175},
  "max_height_mm": 230,
  "source": "https://example.org/author-guide/artwork",
  "checked": "2026-11-26"
 }
}
key what it holds
name the name in the menu (required)
roles a style per kind of text: panel_letter, title, axis_label, tick_label, legend, legend_title, annotation. A style takes size (pt), weight (normal, bold), style (normal, italic) and family (fonts in order of preference; end with DejaVu Sans, which matplotlib ships)
look the figure's look, as in the Look section: line_width_pt, spine_width_pt, tick_width_pt, tick_length_pt, bar_edge_width_pt, tick_direction (in, out, inout), spines, show, bar_edge_color, palette
page journal widths: widths_mm (label → mm), max_height_mm, and the guide they come from
rules what Check tests: min_text_pt, max_text_pt, letter_max_pt (panel letters' own cap), with the guide's source and checked
description, source, checked, comment free text; for a journal, source is the guide's URL and checked the date it was read

Picking a preset makes the layout follow it by reference ("preset": "lab"): its text styles and look are filled in when the layout is compiled, so edit the preset once and every figure that names it follows; anything you set in the layout itself still wins. For a shared project, keep presets beside the layouts in panelist-layouts/presets/ (panelist styles new lab --dir panelist-layouts/presets), so they are versioned with your figures. Journal widths appear in the Page section. Take a journal's numbers from its own author guide and note where (source, checked); panelist styles check reminds you when they are empty. A file with a mistake is skipped, and panelist styles says which one and why.

Try the demo

examples/demo/ has a four-panel figure with made-up data, the one in the screenshots:

cd examples/demo
panelist edit demo_figure.py                     # opens panelist-layouts/demo.layout.json (it draws this script)
panelist compile panelist-layouts/demo.layout.json   # writes demo_layout.py beside demo_figure.py
Editor shortcuts
Action How
Move drag; Shift-drag for straight moves
Nudge arrow keys (0.1 mm), Shift + arrow (1 mm)
Ignore snapping hold Alt
Resize an Axes drag a handle
Select several Shift-click, or drag a box
Enter / leave a group double-click / Esc
Arrange tools right-click
Draw a line, arrow, box, ellipse, text box L, A, R, O, T, then drag (Shift: 45° steps, squares)
Delete a shape or text Delete
Crop a plot C, then drag its edges or corners (Esc: done)
Text styles Alt+3, or the T button
Command palette Ctrl+K
All shortcuts ?
VS Code

Install the .vsix from the latest release with code --install-extension panelist-editor-<version>.vsix. From a clone you can build the same file (cd editor && npm ci && npm run package) or open editor/ as an extension without installing (npm run build, then code --extensionDevelopmentPath=<repo>/editor <folder>). Files named *.layout.json then open on the canvas. Set panelist.python to a Python that can import your plotting code, and panelist.pythonPath to any extra PYTHONPATH it needs.

The layout format, every command and how to extend panelist are documented in AGENTS.md. Working with an AI agent? Point it at that file: it says how to install panelist, where a figure's files are saved, and how to lay out a figure step by step from a terminal.

Related projects

Where the layout lives How you edit it What your script does
pylustrator generated code written into your script drag in an interactive window runs the generated code
FigureFirst an SVG file draw and tag rectangles in Inkscape reads the SVG through FigureFirst
matplotlib layout tools your code numbers and ratios in code contains the layout
Vector editors the exported file by hand, after every export nothing; edits are lost on regeneration
panelist fig.layout.json next to your code drag on the rendered figure one apply_layout call, matplotlib only

pylustrator (Gerum, JOSS 2019) opens a matplotlib figure in an interactive window and saves your changes as generated Python code inside your plotting script. panelist grew out of working with pylustrator and keeps its central idea: edit with the mouse, reproduce the result with code. But panelist writes the result to a separate layout file and never touches your script; it binds panels by name, refuses a layout that does not match, and works in page millimetres with grids and groups. panelist is written from scratch and shares no code with pylustrator.

FigureFirst (Lindsay, van Breugel and Weir, SciPy 2017) also starts from the layout: you draw rectangles in Inkscape, tag them, and FigureFirst turns the SVG into matplotlib Axes. panelist keeps the layout apart from the plotting code in the same way, but you edit it on the rendered figure itself, and the published figure needs only matplotlib.

matplotlib's own tools (subplot_mosaic, gridspec, constrained layout) describe the arrangement in code and suit regular grids. panelist does not replace them. It is for the last step, where panels need exact sizes and positions on a fixed page and are easier to place by eye than by trial and error.

Status

[!NOTE] panelist is an early version (0.1). The layout format is versioned ("panelist": 1) and may still change before 1.0.

Citing and license

If you use panelist in a publication, GitHub's Cite this repository button gives the reference from CITATION.cff. panelist is released under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft