>>>>> "Gregory" == Gregory Piñero <[EMAIL PROTECTED]> writes:

    Gregory> Hi guys, Is this possible?  Specifically I'm trying
    Gregory> implement something close to this example:
    Gregory> http://matplotlib.sourceforge.net/examples/webapp_demo.py

    Gregory> But would like to be able to utilize code found in
    Gregory> samples like this:
    Gregory> http://matplotlib.sourceforge.net/screenshots/pie_demo.py

You just have to tell matplotlib to use Agg as your backend -- pylab
will respect the default backend, whether it is a GUI, Agg or PS.

There are several ways to choose the backend

  * make it permanent by setting your backend to 'Agg' in matplotlibrc

  * change it on a per script basis exterally by launching with the -d
    option

     > python myscript.py -dAgg
     > python myscript.py -dPS
     > python myscript.py -dGTKAgg

  * probably best for a web app, use the matplotlib "use directive".
    This must be done *before* importing pylab

    import matplotlib
    matplotlib.use('Agg')
    import pylab
    plot and save....

This is discussed at http://matplotlib.sf.net/backends.html

JDH

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to