figure-gate
Two scripts that read a built matplotlib figure and report which gates it
fails. audit(fig) returns (ok, rows), 20 rows, one per gate, each a
(label, status, detail) triple where status is True, False, or
"warn". check(colors) gates a palette the same way in 5 rows and returns
the same shape. Every threshold is a module-level constant you can read and
change.
There is also an Agent Skill wrapper that applies the same checks when Claude Code builds a figure.
git clone https://github.com/narenp12/figure-gate && cd figure-gate
python skill/scripts/check_palette.py "#E69F00,#56B4E9,#009E73" --pairs all
python skill/scripts/check_figure.py # self-test on a broken figure
python examples/demo.py builds that figure and audits it, and python examples/gallery.py covers the harder forms.
Writing those seven found six defects in the checks themselves.
Documentation
Everything below the quickstart lives on the docs site:
- Getting started: install or vendor, the two settings that need your document's values, and the code to call.
- The gates: what each row measures, its threshold, and what a passing run does not mean.
- The style guide: the measurement behind each threshold, and the rules tried and reverted.
- Choosing a form: the decision no styling rule rescues.
- API reference: signatures and defaults, generated from the scripts when the site builds.
uv add figure-gate # or: conda install -c conda-forge figure-gate
Where this sits
Prescriptive style sheets already exist and are good: SciencePlots and LovelyPlots for journal looks, tueplots and mpl_sizes for exact conference sizing. Accessibility tooling exists too: matplotalt generates alt text, Chart4Blind converts a chart image into an accessible one, contrast reporters check colors in isolation.
Each of those acts before or beside the figure. None of them reads the built result and reports what it fails, which is the only thing here, so a style sheet and this are complementary: set defaults with one, verify them with the other.
Contributing
New gates are welcome at the bar the project holds itself to: a test proving the gate fails on a figure with that defect, a test proving it does not over-fire on the nearest legitimate case, and a note naming the real failure that motivated it. See CONTRIBUTING.md and SECURITY.md.
License
MIT, see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file figure_gate-0.6.0.tar.gz.
File metadata
- Download URL: figure_gate-0.6.0.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd404271c004dc73c31120ad4cffb0e8a19af98acf807ccb5605453aee71c663
|
|
| MD5 |
b22c04ea3494d5f905b213f94deccf25
|
|
| BLAKE2b-256 |
405f6ad8f827e493bb0d2fa9bbb9237bda4f6902901a728171f11fff217302cb
|
Provenance
The following attestation bundles were made for figure_gate-0.6.0.tar.gz:
Publisher:
release.yml on narenp12/figure-gate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
figure_gate-0.6.0.tar.gz -
Subject digest:
dd404271c004dc73c31120ad4cffb0e8a19af98acf807ccb5605453aee71c663 - Sigstore transparency entry: 2298371612
- Sigstore integration time:
-
Permalink:
narenp12/figure-gate@23a408315b02d4d7c84a42c922c2220e4c448ae9 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/narenp12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@23a408315b02d4d7c84a42c922c2220e4c448ae9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file figure_gate-0.6.0-py3-none-any.whl.
File metadata
- Download URL: figure_gate-0.6.0-py3-none-any.whl
- Upload date:
- Size: 47.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fe75ddcb6103aeecb7388d07fe1c719a422da9925baf8f12a1ade0f908ef06a
|
|
| MD5 |
afc855cfbafe4bf687dd24b342acbc4c
|
|
| BLAKE2b-256 |
7f564c59fc885d24a185dfd51b95b0a0fb3f05afb9aaf4038508c929f9a69a4c
|
Provenance
The following attestation bundles were made for figure_gate-0.6.0-py3-none-any.whl:
Publisher:
release.yml on narenp12/figure-gate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
figure_gate-0.6.0-py3-none-any.whl -
Subject digest:
9fe75ddcb6103aeecb7388d07fe1c719a422da9925baf8f12a1ade0f908ef06a - Sigstore transparency entry: 2298371627
- Sigstore integration time:
-
Permalink:
narenp12/figure-gate@23a408315b02d4d7c84a42c922c2220e4c448ae9 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/narenp12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@23a408315b02d4d7c84a42c922c2220e4c448ae9 -
Trigger Event:
push
-
Statement type: