Skip to main content

Remember that time where you tried to remake a figure for your paper and couldn’t seem to get the same results? We’ve all been there. Well not anymore!

This module monkey patches the savefig command from matplotlib and inserts your current git commit hash into the metadata of the saved file. Currently it supports PNG and PDF figures.

Usage

First, install the module from PyPI:

pip install savefig

or from source:

git clone https://github.com/dfm/savefig.git
cd savefig
python setup.py install

Then in all your code just add the following lines before importing matplotlib:

from savefig import monkey_patch
monkey_patch()

To read the metadata from an existing image file, run:

python -m savefig /path/to/figure.png

License

Copyright 2014 Dan Foreman-Mackey

Available under the MIT License.

Metadata

Release files for savefig 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for savefig 0.0.1
File Size Uploaded
savefig-0.0.1.tar.gz 4.0 kB Details

Release files / savefig-0.0.1.tar.gz

Download URL savefig-0.0.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e49ddbb83fe2e2368881c2e267f15004facae524329a80fbd58f228d28ee317f
BLAKE2b-256 checksum
How to use checksums
266bab6a38014247576392949d1978265d4395e22f9fe4aaca089473208b1e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page