[SciPy-user] Failed to plot array using gnuplot-py

iCy-fLaME icy.flame.gm at gmail.com
Wed Feb 1 12:48:10 CST 2006


On 2/1/06, Robert Kern <robert.kern at gmail.com> wrote:
> iCy-fLaME wrote:
> > Not sure what is going on, dont even know if this is a glitch cause by
> > gnuplot-py or scipy or python itself, but here is what i found out on
> > my system.
> >
> > Fedora Core 4
> > gnuplot-4.0.0-7
> > gnuplot-py-1.7-1
> > SciPy 0.4.4
> >
> > It wouldnt plot if i do this:
> > =================================
> > from scipy import linspace
> > import Gnuplot
> > g = Gnuplot.Gnuplot(debug = 1)
> > x = linspace(0, 1, 20).astype('f')        # i.e. array(0.0, 0.05, 0.10, ... 1.0)
> > y = linspace(0, 5, 20).astype('f')
> > d = Gnuplot.Data(x, y)
> > g.plot(d)
> > =================================
>
> Did you see an error message, or did it just do nothing? What version of Numeric
> do you have installed? I'm pretty sure the Gnuplot module still uses Numeric and
> may not recognize numpy arrays. Hopefully, it will try to do something like
> Numeric.asarray(x). If Numeric's version is >=24.0, that should automatically
> convert the numpy array to a Numeric array efficiently.
>
> --
> Robert Kern
> robert.kern at gmail.com
>
> "In the fields of hell where the grass grows high
>  Are the graves of dreams allowed to die."
>   -- Richard Harter
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>


It opened a x11 window, but nothing is plotted. Sometimes it complain
about the range. I have a feeling it is converting all float to int,
hence all zero and nothing to plot.

It plots fine if i make x range >> than 1:
=================================
from scipy import linspace
import Gnuplot
g = Gnuplot.Gnuplot(debug = 1)
x = linspace(0, 10, 20).astype('f')        # Make the end point >> 1
y = linspace(0, 50, 20).astype('f')
d = Gnuplot.Data(x, y)
g.plot(d)
=================================

Ahh, my Numeric version is '23.7'


--
iCy-fLaME
The body maybe wounded, but it is the mind that hurts.


More information about the SciPy-user mailing list