| icon | lucide/rocket |
|---|
A Python suite for reproducible, reviewable, and editable scientific figures.
FigWorks composes Matplotlib and Plotly plots, VecTeX equations, VecView scenes, VecWire circuits, and native SVG annotations. Readable source, shared style settings, and semantic SVG keep figures inspectable from computation to final layout. Deterministic builds require the same inputs, tools, and fonts.
The canonical output is SVG. PDF and PNG export are supported through CairoSVG. Named elements and panels carry stable identifiers so the final graphic stays editable programmatically.
Figures you own, even when AI helped make them. An assistant can draft the script, but what you keep is plain Python in your repository and SVG with named parts: every number traces back to code you can check, every label can be changed by hand, and the figure rebuilds from source whenever you need it.
The gallery shows journal figures from across the sciences: quantum devices, graphene, photonics, biophysics, neuroscience, exoplanets, reaction chemistry, the climate, economics, and electronics.
FigWorks is the composition layer of a four-project suite: VecTeX renders TeX equations to SVG fragments, VecView draws layered 3D schematics as SVG documents, and VecWire draws editable circuit schematics as SVG documents. Each is developed independently and usable alone.
All three producers integrate through one method, to_svg_document(), so
FigWorks needs no adapter for any of them and none imports FigWorks.
- SVG-native assembly — build figures from real vector elements.
- Matplotlib integration — embed Matplotlib figures as SVG, and import SVG back into Matplotlib, in both directions.
- Semantic selectors — address any element by
#id,.class, or tag name. - Physical units — lay out in
px,pt,mm,cm, orin. - Export anywhere — save to
.svg,.pdf, and.png.
!!! note
FigWorks is designed as an *editable assembly layer* between your plotting
code and the final publication graphic. It does not try to replace
Matplotlib, Inkscape, Illustrator, or LaTeX.
| Area | What you can do |
|---|---|
| Figure | Create an SVG canvas with physical dimensions and a theme. |
| Panels | Define rectangular regions with anchors. |
| Matplotlib | Export figures to SVG, embed them as panels, or import SVG as Matplotlib artists. |
| Placeholders | Reserve a region and fill it with SVG content later by id. |
| Layout | Assemble many SVG panels into a labelled grid. |
| Selectors | Select, style, and delete elements by id, class, or tag. |
| Elements | Add text, labels, rects, lines, circles, ellipses, polylines, paths, and arrows. |
| Export | Save to SVG, PDF, and PNG; display inline in notebooks. |
python -m pip install figworks
To work on FigWorks itself, see Development.
| Symbol | Purpose |
|---|---|
Figure |
Top-level SVG figure and assembly API. |
Panel |
A named, anchored rectangular region of a figure. |
Anchor |
A named absolute point (panel corners, edges, center). |
Theme |
Default styling (fonts, strokes, label sizes). |
load_theme |
Load a built-in style or a style.md as a Theme. |
FigureCollection |
Build a set of figures under one style. |
compose |
Insert SVG content into Matplotlib axes. |
CheckReport, CheckIssue |
The result of Figure.check() preflight. |
layout_svgs |
Assemble multiple SVGs into a labelled grid. |
display_svg |
Render an SVG / figure inline in a notebook. |