Ken McIvor wrote:
I need to be able to render a plot (actually a pie) in png, jpg, or gif format directly into a variable that I can return to the application server. I'm currently using the rather ugly method of writing to a temp file and then reading it back in and returning the data. Is there a way to do this completely in memory?
Thanks for the response.
Yes, shortly after I sumitted my question to the list I found that on the wiki. After thinking about it a bit, I decided that the creation of a temporary file, which only exists for a fraction of a second before being deleted (and therefore never makes it to disk), does not cost me that much, and is really the simpler solution. It would be nice if I could do:
image = render(figure, format='png')
But hey, I'm not complaining. Matplotlib was there when I needed it and does what I need it to do.
I've been using OSS for about ten years now. And for the most part I take it for granted that I'll be able to do what I need to do with OSS.
But when you think about it, it's really pretty amazing that there is always a safety net there that works, and works well. Sometimes the safety net is aestheticly pleasing. Sometimes not. And sometimes it doesn't seem so at first, but seems more pleasing the closer you get to it.
One thing that people forget to do is thank the developers. Oh, we l^Husers do it. But we tend to note the times that we do and forget the times we don't.
Thank You All.
Oh, and thread_object.acquire(True) and thread_object.release() are still my friends.
On Mar 25, 2006, at 10:15 AM, Steve Bergman wrote: