|
From: David T. <dav...@gm...> - 2006-02-11 17:04:52
|
Hello, Maybe you have to upgrade your numeric to 24.2 Refer to the recent thread in gnuplot-py-user list: http://sourceforge.net/mailarchive/forum.php?forum_id=3D11272&max_rows=3D25= &style=3Dnested&viewmonth=3D200602 David 2006/2/10, Brian Blais <bb...@br...>: > > Hello, > > I have been trying to use the Gnuplot1.7.py module, but it doesn't seem t= o > work with > numpy (although it works with Numeric). The following code plots two > "identical" > sets of data, but the numpy data gets rounded to the nearest integer when > passed to > Gnuplot. What is odd is that the offending code in utils.py, is the > function > float_array(m), which does the conversion that I do in this script, but i= t > doesn't > seem to work. Any ideas? > > #---------------------------- > import numpy > import Numeric > import Gnuplot > > g =3D Gnuplot.Gnuplot(debug=3D1) > dh=3D.1; > x=3Dnumpy.arange(dh,2+dh,dh,'d') > y1 =3D x**2 > > > y2=3Dy1 > > d1 =3D Gnuplot.Data(x, y1, > title=3D'numpy', > with=3D'points') # doesn't work > d2 =3D Gnuplot.Data(Numeric.asarray(x,'f'), Numeric.asarray(y2,'f'), > title=3D'Numeric', > with=3D'points') # works > > g.plot(d1,d2) > > #---------------------------- > > > > > thanks, > > bb > > -- > ----------------- > > bb...@br... > http://web.bryant.edu/~bblais<http://web.bryant.edu/%7Ebblai= s> > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |