Skip to main content

Save matplotlib figures with embedded metadata for reproducibility and profit

Project description

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.

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

savefig-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file savefig-0.0.1.tar.gz.

File metadata

  • Download URL: savefig-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for savefig-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e49ddbb83fe2e2368881c2e267f15004facae524329a80fbd58f228d28ee317f
MD5 434072962e30910e5d951cad52e28914
BLAKE2b-256 266bab6a38014247576392949d1978265d4395e22f9fe4aaca089473208b1e44

See more details on using hashes here.

Supported by

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