From: Rajan G. <rjn...@gm...> - 2010-03-10 16:53:05
|
Hi, I have gnuplot-py-1.8 (is residing in site-packages dir of Python) Python 2.5 (residing in C) Gnuplot v4.4 (residing in C:\Program Files and also a different named copy in C:\). O.S: Win ME (I only hope this does not discourage you from reading further) I have been able to run python codes with numpy without much issue but never tried plotting using Gnuplot. I would use Excel to plot the data files until I decided Gnuplot was the way to go. The binary setup installation ran well for all. I think all the paths are defined - because I am able to give a command "python" from any directory and I get to the python shell immediately. Also typing "wgnuplot" or "pgnuplot" from any directory I am able to open the Gnuplot terminal and plot functions such as sinx/x etc. However, when I go to Python25\Lib\site-packages\Gnuplot and run 'python test.py' from command window or run test.py from IDLE, the computer immediately crashes and I have to reboot. Earlier, I would get it to work till print ( 'This program exercises many of the features of Gnuplot.py. The\n' 'commands that are actually sent to gnuplot are printed for your\n' 'enjoyment.' ) wait('Popping up a blank gnuplot window on your screen.') g = Gnuplot.Gnuplot(debug=1) g.clear() # Make two temporary files: if hasattr(tempfile, 'mkstemp'): (fd, filename1,) = tempfile.mkstemp(text=1) f = os.fdopen(fd, 'w') (fd, filename2,) = tempfile.mkstemp(text=1) else: filename1 = tempfile.mktemp() f = open(filename1, 'w') filename2 = tempfile.mktemp() try: for x in numpy.arange(100.)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x))) f.close() print '############### test Func ###################################' wait('Plot a gnuplot-generated function') And then the screen would freeze and I had to reboot. However, I never get the plot window and the Gnuplot terminal to open up. The reason I say the above commands worked is because I can see the printout in my DOS command window. I can also see the tmp files in the TEMP directory. I tried playing around mainly changing the paths or changing the directory of Gnuplot from Program Files to just C:\ - thinking that the space could be an issue. I tried running other programs such as demo.py. After several such trials, now I am not able to see any messages on the command window because DOS window just disappears and I see a blue screen asking me to cntrl-alt-del or to reboot. I further debugged and saw that ' temp' data files e.g., in the demo.py were being written to temp files. It is only when it comes to plotting that the computer hangs. I then tried this: I changed the name of the Gnuplot (i.e., Gnuplot app 4.4) directory to 'guplot' but without making changes to the PATH, and then I ran the demo program - my thought was that it should not be able to find the Gnuplot application and would give me some error messages rather than computer hanging. But unfortunately, the computer still hangs for test.py. It runs all the way till print '############### test Func ###################################' wait('Plot a gnuplot-generated function') and then goes bust. Although the command window diappears in a flash I can make out the long comment line stated above. Again none of the command or plot windows pertaining to Gnuplot open up. The entire screen just blinks and then becomes dead. Another fact I would like to mention is that I tried all the above on Win XP at my work, under similar file configuration and I get no issues at all. I guess this is how far I have been able to proceed. Any help would be appreciated despite that fact that I will be strongly discouraged from using WinME (I will eventually transition to Linux) but it will take some time. I just feel that this is a solvable problem and may not be a Win ME issue (hope!!). Rajan |