On Tue, Jul 7, 2009 at 6:41 PM, Doug Penner<darwinsurvi...@gmail.com> wrote:

> so instead of doing
>
>    plt.savefig("some/location.png")
>
>    return HttpResponse("<html><body><img src='some/location.png'
> /></body></html>")
>
> I could do
>
>    return HttpResponse(plt.image_render('image/png'), mimetype="image/png")
>
> and not have to worry about deleting the image later (there are LOT that
> get generated)

You can save directly to a file handle (eg sys.stdout) so you need not
go to a PNG file.  Alternatively, you can write to a StringIO object.
See the examples at

  
http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server

And if you would be willing to complete the FAQ stub for Django

  http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-with-django

That would be much appreciated.  See

  http://matplotlib.sourceforge.net/faq/howto_faq.html#how-to-contribute-docs

Thanks,
JDH

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to