From: Michael T. C. <mt...@ic...> - 2003-01-08 21:13:47
|
Thanks to everyone for the input. Turned out that adding the path to gnuplot in the bash script that was calling the gnuplot.py routine which is all being called from a cron entry did the trick. Thanks again, mtc Michael Haggerty wrote: > Hi, > > My guess is that "gnuplot: not found" indicates that the gnuplot > program (not the Python package but the program itself) is not in your > PATH. > > If that is not the case, make sure that you don't have problems with > temporary files being deleted before they are used. The FAQ.txt file > in the latest CVS version of Gnuplot.py has more information about > this well-known problem. > > If you are interested in Gnuplot.py issues, you might consider > subscribing to the mailing list. You can do that through SourceForge, > > http://sourceforge.net/projects/gnuplot-py > > Let me know if it helps, > Michael > > Michael T. Colee wrote: > >> Hello and thanks for the efforts on gnuplot.py, really a nice tool. >> I'm hoping you might have some insight into a problem I'm having as a >> relatively new python and gnuplot.py user. >> >> I've written a rather brute force script that generates png plots of >> various meteorological fields for posting on a web page. When I run >> it from the command line it functions beautifully and generates all >> my plots in the locations I want them. If you are curious to see the >> results what I'm doing you can look at: >> >> http://neige.bren.ucsb.edu/mmsa/images/weekly/default.htm >> & >> http://neige.bren.ucsb.edu/mmsa/images/daily/default.htm >> >> When I go to run the routine scheduled from a cron entry however, it >> chokes. The system I'm on is running W2K server and I've got cron >> running under cygwin which calls various scripts every hour to >> generate the pages I need. Other python scripts work fine in this >> manner, for example, the following page: >> >> http://neige.bren.ucsb.edu/mmsa/images/hourly/LatestMet.htm >> >> is automatically generated hourly from a seperate python script >> called from the same cron entry. >> >> So, the code (Plotmmsa.py) I'm having trouble with is: >> >> _________________________________________________________ >> #...bunch of prep stuff cut out for brevity... >> print "Read in and set various lists, starting plots. Last depth >> reading:" >> print PlatformTemp[-1:] #make sure we've got data in our lists (we do). >> >> #g = Gnuplot.Gnuplot() >> g = Gnuplot.Gnuplot(debug=1) #debug=1 outputs gnuplot commands to stdout >> g('set data style lines') >> #g('set data style linespoints') >> g('set term png color') >> >> >> g.title('Temperature') >> g.xlabel('Day of Year') >> g.ylabel('Degrees C') >> #This is line 106 which seems to be the problem: >> g('set output "/home/mmsa/wwwroot/mmsa/images/weekly/PlatformTemp.png"') >> g.plot(PlatformTemp[-700:]) #Plot the last 7 days of data. >> time.sleep(1) #Wait for gnuplot to do it's thing. >> g('set output "/home/mmsa/wwwroot/mmsa/images/daily/PlatformTemp.png"') >> g.plot(PlatformTemp[-96:]) #Plot the last day of data. >> time.sleep(1) #Wait for gnuplot to do it's thing. >> #...Rest of plots left out for brevity... >> __________________________________________________________ >> >> >> Output from running Plotmmsa.py at the command prompt: >> >> $ ../bin/python/Plotmmsa.py >> Read in and set various lists, starting plots. Last depth reading: >> [[7.458333333333333, 3.8610000000000002]] >> gnuplot> set data style lines >> gnuplot> set term png color >> gnuplot> set title "Temperature" >> gnuplot> set xlabel "Day of Year" >> gnuplot> set ylabel "Degrees C" >> gnuplot> set output >> "/home/mmsa/wwwroot/mmsa/images/weekly/PlatformTemp.png" >> gnuplot> plot '/cygdrive/c/WINNT/TEMP/@1648.0' notitle >> gnuplot> set output >> "/home/mmsa/wwwroot/mmsa/images/daily/PlatformTemp.png" >> gnuplot> plot '/cygdrive/c/WINNT/TEMP/@1648.1' notitle >> __________________________________________________________ >> >> Output from cron running the same program: >> >> gnuplot> set data style lines >> gnuplot> set term png color >> gnuplot> set title "Temperature" >> gnuplot> set xlabel "Day of Year" >> gnuplot> set ylabel "Degrees C" >> gnuplot> set output >> "/home/mmsa/wwwroot/mmsa/images/weekly/PlatformTemp.png" >> gnuplot> plot '/cygdrive/c/WINNT/TEMP/@1984.0' notitle >> gnuplot: not found >> Read in and set various lists, starting plots. Last depth reading: >> [[7.458333333333333, 3.8610000000000002]] >> Traceback (most recent call last): >> File "/home/mmsa/bin/python/Plotmmsa.py", line 106, in ? >> g('set output >> "/home/mmsa/wwwroot/mmsa/images/daily/PlatformTemp.png"') >> File "/usr/lib/python2.2/site-packages/Gnuplot/_Gnuplot.py", line >> 206, in __call__ >> self.gnuplot(s) >> File "/usr/lib/python2.2/site-packages/Gnuplot/gp_unix.py", line >> 203, in __call__ >> self.flush() >> IOError: [Errno 32] Broken pipe >> >> _________________________________________________________ >> >> Any suggestions would be much appreciated. My next step will be to >> get gnuplot.py running on a linux box and see if I have the same >> problems there. >> >> Thanks in advance, >> mtc >> > > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Michael Colee Internet: mt...@ic... ICESS & Bren SESM Phone : (805) 893-2883 University of California Fax : (805) 893-6113 Santa Barbara CA 93106-3060 Office : 1001 Bren Hall =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |