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.


First, install the module from PyPI:

pip install savefig

or from source:

git clone
cd savefig
python install

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

from savefig import monkey_patch

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

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


Copyright 2014 Dan Foreman-Mackey

Available under the MIT License.

Project details

Release history Release notifications

History Node


History Node


History Node


This version
History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
savefig-0.0.1.tar.gz (4.0 kB) Copy SHA256 hash SHA256 Source None Mar 30, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page