skip to navigation
skip to content

Not Logged In

pngrenderer 0.1.2

Render matplotlib png images to a zip file

# 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`
 
File Type Py Version Uploaded on Size
pngrenderer-0.1.2-py27-none-any.whl (md5) Python Wheel 2.7 2013-12-04 5KB
pngrenderer-0.1.2.tar.gz (md5) Source 2013-12-04 163KB
  • Downloads (All Versions):
  • 14 downloads in the last day
  • 154 downloads in the last week
  • 551 downloads in the last month
  • Author: Simon Walker
  • Home Page: https://github.com/mindriot101/matplotlib-pngrenderer
  • License:
    The MIT License (MIT)
    
    Copyright (c) 2013 Simon Walker
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
  • Package Index Owner: srwalker101
  • DOAP record: pngrenderer-0.1.2.xml