471,330 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

matplotlib & mod_python

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
sys.stdout):

TyperError: Could not convert object to file pointer

Is there a way to to this thing ?

Thank you very much for any suggestion,
Paolo

Oct 26 '07 #1
0 896

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by fortuneteller | last post: by
1 post views Thread by Tama | last post: by
5 posts views Thread by m.banaouas | last post: by
2 posts views Thread by Jan Danielsson | last post: by
1 post views Thread by Jan Danielsson | last post: by
4 posts views Thread by John Henry | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.