Re: [Matplotlib-users] matplotlib and cron

2008-05-08 Thread Andrew Straw
Andre, my guess is that there's an attempt made to connect to the
(non-existant) X server. You can disable this by forcing a backend that
doesn't need the X server. Try

import matplotlib
matplotlib.use('Agg')

before the rest of your script.

Andre Wong wrote:
 Hi

 I am attempting to generate graphs using matplotlib/pyplot via a cron 
 process. These scripts work perfectly fine when I am logged in and run 
 the scripts on the command line, however they fail to run when they are 
 set up as a cronjob. Even a simplified plotting routine does not work:

 from matplotlib.pylab import plot
 from matplotlib.pylab import savefig

 plot([1,2,3,4])
 savefig('test.png')

 my crontab is configured like this:

 SHELL= /bin/tcsh
 45 8 * * * cd [path to script]; python graphtest.py


 Thanks in advance,

   


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib and cron

2008-05-07 Thread Andre Wong
Hi

I am attempting to generate graphs using matplotlib/pyplot via a cron 
process. These scripts work perfectly fine when I am logged in and run 
the scripts on the command line, however they fail to run when they are 
set up as a cronjob. Even a simplified plotting routine does not work:

from matplotlib.pylab import plot
from matplotlib.pylab import savefig

plot([1,2,3,4])
savefig('test.png')

my crontab is configured like this:

SHELL= /bin/tcsh
45 8 * * * cd [path to script]; python graphtest.py


Thanks in advance,

-- 
Andre Wong
Gemini North Data Analyst
[EMAIL PROTECTED]
(808) 974 2626



-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users