Plotting Problems when using Scitools

59 views
Skip to first unread message

hrh1818

unread,
Oct 23, 2009, 11:18:33 PM10/23/09
to scitools
So far I have not been able to use scitools to plot a curve. The
following sequence shows the plotting commands I use and the error I
get.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
D:\Documents and Settings\Howard>cd \

D:\>python
Python 2.6.3 (r263rc1:75186, Oct 2 2009, 20:40:30) [MSC v.1500 32 bit
(Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from scitools.std import *
scitools.easyviz backend is gnuplot
>>> def f(t):
... return t**2*exp(-t**2)
...
>>> t = linspace(0, 3, 51)
>>> y = f(t)
>>> plot(t, y)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\python26\lib\site-packages\scitools\easyviz\common.py",
line 3061, in
plot
self._replot()
File "D:\python26\lib\site-packages\scitools\easyviz\gnuplot_.py",
line 1097,
in _replot
self._g.reset()
File "D:\python26\lib\site-packages\Gnuplot\_Gnuplot.py", line 366,
in reset
self('reset')
File "D:\python26\lib\site-packages\Gnuplot\_Gnuplot.py", line 210,
in __call_
_
self.gnuplot(s)
File "D:\python26\lib\site-packages\Gnuplot\gp_win32.py", line 130,
in __call_
_
self.write(s + '\n')
IOError: [Errno 22] Invalid argument
>>>

I am using:
python-2.6.3
numpy-1.3.0-win32*python2.6
scipy-0.7.1-win32*python2.6
scitoos-0.6.win32
gnuplot version 4.2.6
gnuplot.py-1.8
Windows XP

I have also tried using the exact same plotting commands with the 2.5
versions of python, numpy and scipy and Windows 7 and get the same
[Errno 22] Invalid argument error. Hence it appears the most likely
source of the bug in the code is the scitools module.

What should I do to fix this Error 22 problem?

Howard

Johannes Ring

unread,
Oct 26, 2009, 4:24:05 AM10/26/09
to scit...@googlegroups.com
Hi Howard,

No, this is most likely not a bug in SciTools.

> What should I do to fix this Error 22 problem?

This is a Gnuplot.py error and you get this when you don't have the
Gnuplot binaries in your PATH environment variable. If you installed
Gnuplot to C:\gnuplot then try to add C:\gnuplot\bin to PATH and run
your SciTools example again.

Best regards,

Johannes

Howard Hansen

unread,
Oct 26, 2009, 11:27:32 AM10/26/09
to scit...@googlegroups.com
Hello Johannes,

Your advice was dead on. I had set the Gnuplot Path environment
variable to D:\gnuplot. Changing the Path environment variable to
D:\gnuplot\bin fixed the problem. It had to be a silly mistake like this
as nobody else was reporting this type of problem to the Scitools
mailing list.

Thank You, your help is highly appreciated. As it removes a big
stumbling block that was keeping me from running the examples provided
in the book "A Primer on Scientific Programming with Python".

Howard
Reply all
Reply to author
Forward
0 new messages