I struggled with this.  The complete example is at
http://www.web2pyslices.com/main/slices/take_slice/30

On Dec 5, 10:26 pm, Pumplerod <[email protected]> wrote:
> Ahh.  Thank you.  It was the inclusion part I couldn't grasp.
>
> On Dec 5, 8:47 pm, Massimo Di Pierro <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > def myimage():
> >     import cSringIO
> >     fig=Figure()
> >     ...
> >     canvas=FigureCanvas(fig)
> >     stream=cStringIO.StringIO()
> >     canvas.print_png(stream)
> >     return stream.getvalue()
>
> > then use {{=IMG(_src=URL('myimage'))}} to include it.
>
> > On Dec 5, 10:32 pm, Pumplerod <[email protected]> wrote:
>
> > > Is there a way, or example, I could be pointed to which demonstrates
> > > using mathplotlib to plot upon request without writing the image file
> > > to disk?
>
> > > I'm able to create my plot and save it to the static/images directory
> > > which then I can load within my view, however I would like to be able
> > > to generate the image without having to save the file first.

Reply via email to