*Non-interactive* image generation?

I would like to use pylab in a CGI script that would generate a pie
chart/bar graph/…, save it to a file, and then be able to output the
image from the file.

Everything that I’ve tried works if I run
the script from my shell, but when it runs on my test box (or, for that
matter, a sudo without an X display being set up), it gripes about not
being able to open an X display.

Is there a way to either:

1: Tell pylab to run without a display,
2: Configure a dummy display, or
3: Attach the web environment to a real display?

I’m not having it display windows or asking for interesting X functionality–just generate a pie chart and save it as a file.

···


– Jonathan Hayward, christos.jonathan.hayward@…287…

** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?

** All of this is waiting for you at http://JonathansCorner.com

++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com

You probably want to look at this FAQ:

http://matplotlib.sourceforge.net/faq.html#APPSERVER

Or the slightly more updated and elaborate answer in the new (in-progress) docs:

http://matplotlib.sourceforge.net/doc/html/faq/howto_faq.html#how-do-i-use-matplotlib-in-a-web-application-server

Cheers,
Mike

"Jonathan Hayward http://JonathansCorner.com" wrote:

···

I would like to use pylab in a CGI script that would generate a pie chart/bar graph/..., save it to a file, and then be able to output the image from the file.

Everything that I've tried works if I run the script from my shell, but when it runs on my test box (or, for that matter, a sudo without an X display being set up), it gripes about not being able to open an X display.

Is there a way to either:

1: Tell pylab to run without a display,
2: Configure a dummy display, or
3: Attach the web environment to a real display?

I'm not having it display windows or asking for interesting X functionality--just generate a pie chart and save it as a file.


– Jonathan Hayward, christos.jonathan.hayward@…287… <mailto:christos.jonathan.hayward@…287…>

** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com

++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com
------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA