Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > matplotlib & mod_python

Thread Tools

matplotlib & mod_python

Posts: n/a
Hi all.

I would like to use a "combination" of matplotlib and mod_python to
create a
PNG figure on the fly in my web site.
The mod_python handler code should be something like this:

def handler(req):

fig = Figure()
... figure creation stuff
canvas = FigureCanvasAgg(fig)
canvas.print_figure(req, dpi=72)

return apache.OK

This code gives me an error as req is not a file-like instance (as

TyperError: Could not convert object to file pointer

Is there a way to to this thing ?

Thank you very much for any suggestion,

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post is garbled is garbled blbmdsmith Python 1 12-14-2006 12:15 AM
MatPlotLib.MatLab troubles (how to install/run matplotlib.PyLab?) Dr. Colombes Python 3 02-23-2005 04:32 PM
Animations with matplotlib? Pekko Piirola Python 1 11-26-2003 12:48 PM
ANN matplotlib-0.30 - matlab style python plotting John Hunter Python 0 10-21-2003 07:42 PM
ANN: matplotlib 0.21 -- matlab compatible plotting in python John Hunter Python 0 08-26-2003 03:26 PM