Skip to main content

Reproducible matplotlib wrapper with mm-precision layouts

Project description

FigRecipe

Reproducible scientific figures as first-class objects

PyPI version Tests License: AGPL-3.0

FigRecipe is a framework for creating reproducible, editable, and publication-ready scientific figures.

Instead of treating figures as static images, FigRecipe treats them as structured objects — with explicit data, layout, and style — that can be reproduced, edited, and shared.

Part of SciTeX™.

FigRecipe GUI Editor

Why FigRecipe?

Most scientific figures are created by code, but cannot be reproduced once the code is lost or modified.

FigRecipe solves this by separating:

  • What is plotted (data & semantics)
  • How it is styled (layout, colors, typography)
  • How it is edited (GUI or code)

This makes figures: reproducible · inspectable · editable after publication

Quick Start

pip install figrecipe
import figrecipe as fr
import numpy as np

fig, ax = fr.subplots()
ax.plot(np.sin(np.linspace(0, 10, 100)), id="sine")

fr.save(fig, "figure.png")  # → figure.png + figure.yaml

Reopen and edit later:

fig, ax = fr.load("figure.png")
fr.edit(fig)  # Launch GUI editor

CLI:

figrecipe edit figure.png      # Launch GUI editor
figrecipe reproduce fig.yaml   # Recreate figure
figrecipe extract fig.yaml     # Extract plotted data

What Makes FigRecipe Different?

🔹 Figures are first-class objects — Figures are not just images — they are structured, versionable artifacts.

🔹 Declarative, not imperative — You describe what the figure is, not just how to draw it.

🔹 GUI + Code coexist — The GUI is a frontend, not a black box. Everything is backed by a reproducible spec.

🔹 Millimeter-precise layout — Designed for journal figures, not dashboards.

Core Features
  • Drop-in replacement for matplotlib.pyplot
  • Fully reproducible figure recipes (.yaml)
  • Publication-ready millimeter layout
  • Interactive GUI editor
  • Dark / light themes
  • Works with existing matplotlib code
Save / Load Formats
fr.save(fig, "fig.png")     # fig.png + fig.yaml
fr.save(fig, "bundle/")     # directory bundle
fr.save(fig, "fig.zip")     # zip bundle

fr.load("fig.png")
fr.load("bundle/")
fr.load("fig.zip")
Format Save Load
PNG / PDF / SVG
YAML
Directory / ZIP
Style Presets
fr.list_presets()
fr.load_style("SCITEX")
fr.load_style("SCITEX_DARK")
Millimeter-based Layout
fig, ax = fr.subplots(
    axes_width_mm=60,
    axes_height_mm=40,
    margin_left_mm=15,
)
Figure Captions
fig.set_caption("Main figure description")
ax.set_caption("Panel A description")

Who Is This For?

FigRecipe is designed for researchers who:

  • already use matplotlib or seaborn
  • care about reproducibility and traceability
  • want figures that survive revisions and collaboration
  • are tired of re-writing plotting code

It is not meant to replace exploratory notebooks or quick plotting — it is meant to formalize results.

Philosophy

A scientific figure is not an image. It is a structured representation of knowledge.

FigRecipe treats figures as first-class scientific objects.


SciTeX
AGPL-3.0 · ywatanabe@scitex.ai

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figrecipe-0.12.0.tar.gz (15.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

figrecipe-0.12.0-py3-none-any.whl (551.2 kB view details)

Uploaded Python 3

File details

Details for the file figrecipe-0.12.0.tar.gz.

File metadata

  • Download URL: figrecipe-0.12.0.tar.gz
  • Upload date:
  • Size: 15.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for figrecipe-0.12.0.tar.gz
Algorithm Hash digest
SHA256 2da45450b3e1fe388165deb3b48b76542d9a17cd6409e49534a89dd183eb3549
MD5 820378d1150d2c44fe20f5746b5b865b
BLAKE2b-256 c34068e456200e27229961f5ccb8819c539e29e90ea1f0175192142d6325bef9

See more details on using hashes here.

File details

Details for the file figrecipe-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: figrecipe-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 551.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for figrecipe-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 830a0c9e47c538f62b0d6f94657e61664456f8cdd7dae9e13d3ad788c153a8df
MD5 0693c6a9fec689706598a5865ef740b2
BLAKE2b-256 06bfd34090b8eb31ff802dde21b8e4f67b554990914ba35bc69aff1623c2dd4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page