It seems that it can be done via PIL.ImageFileIO.
It can be used when dynamically creating a PDF on the web and returning it.
from StringIO import StringIO
from PIL import ImageFileIO
import matplotlib.pyplot as plt
from reportlab.platypus import Image
buf = StringIO()
#plot your graphs
plt.save_figure(buf, format="png")
buf.seek(0)
im = ImageFileIO.ImageFileIO(buf)
flowable_image = Image(im)
https://gist.github.com/kokardy/5967661
Recommended Posts