Render matplotlib png images to a zip file
Project description
# PNG Renderer
For constructing a zip file of png images. I created this package as I had many plots associated from the output of a plotting script and wanted to keep them together. Similar to `matplotlib.backends.PdfPages` I wanted to associate the images, but using the `png` format, so I chose to zip the collection of images. I wanted png images as they contained large amounts of data which created extremely large pdf files.
## Example usage
``` python
import matplotlib.pyplot as plt
from pngrenderer import PNGRenderer
fig = plt.figure()
plt.plot(...)
# Save the resulting image(s) to "out.zip"
renderer = PNGRenderer("out")
# Save the first png image
renderer.savefig("first.png")
# Alternatively call .save_page
# renderer.save_page("first.png")
# Render the zip file to disk
renderer.render()
# Alternatively use the context manager
from pngrenderer import png_render
with png_render("out") as renderer:
renderer.savefig()
# The context manager calls the `render` method
```
## Requirements and installation
This package requires matplotlib, but no other packages
Installation: `pip install git+https://github.com/mindriot101/pngrenderer.git`
If this package ever makes it onto pypi then probably the installation will be `pip install matplotlib-pngrenderer`.
## Contributing
To contribute, clone the repository at [this github link](https://github.com/mindriot101/matplotlib-pngrenderer), and run the tests with `python setup.py test`
For constructing a zip file of png images. I created this package as I had many plots associated from the output of a plotting script and wanted to keep them together. Similar to `matplotlib.backends.PdfPages` I wanted to associate the images, but using the `png` format, so I chose to zip the collection of images. I wanted png images as they contained large amounts of data which created extremely large pdf files.
## Example usage
``` python
import matplotlib.pyplot as plt
from pngrenderer import PNGRenderer
fig = plt.figure()
plt.plot(...)
# Save the resulting image(s) to "out.zip"
renderer = PNGRenderer("out")
# Save the first png image
renderer.savefig("first.png")
# Alternatively call .save_page
# renderer.save_page("first.png")
# Render the zip file to disk
renderer.render()
# Alternatively use the context manager
from pngrenderer import png_render
with png_render("out") as renderer:
renderer.savefig()
# The context manager calls the `render` method
```
## Requirements and installation
This package requires matplotlib, but no other packages
Installation: `pip install git+https://github.com/mindriot101/pngrenderer.git`
If this package ever makes it onto pypi then probably the installation will be `pip install matplotlib-pngrenderer`.
## Contributing
To contribute, clone the repository at [this github link](https://github.com/mindriot101/matplotlib-pngrenderer), and run the tests with `python setup.py test`
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pngrenderer-0.1.2.tar.gz
(167.7 kB
view details)
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 pngrenderer-0.1.2.tar.gz.
File metadata
- Download URL: pngrenderer-0.1.2.tar.gz
- Upload date:
- Size: 167.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
947282f2beec781764ba5de064874e526c67e08f8deec795ecee0245d177c738
|
|
| MD5 |
5a1e0a7c5f530d0330d20ec742a5115b
|
|
| BLAKE2b-256 |
8a0fae8d075d66f59669a29c9cae1e13f776d925b12d74b1297f48f080821a02
|
File details
Details for the file pngrenderer-0.1.2-py27-none-any.whl.
File metadata
- Download URL: pngrenderer-0.1.2-py27-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 2.7
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e83996b387e1a4a304bdd00c9f33a1d0148bd9eb4f82b7c35354c068e3ef67c5
|
|
| MD5 |
c757e8a342f35f4242b09bd05bd30a3f
|
|
| BLAKE2b-256 |
233f0a67ee5040582450fdfaaea53bac98869f171ac2686d81a77394c94518ff
|