[Numpy-discussion] gnuplot problem with numpy

David TREMOUILLES david.trem at gmail.com
Sat Feb 11 09:05:03 CST 2006


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=11272&max_rows=25&style=nested&viewmonth=200602


David

2006/2/10, Brian Blais <bblais at bryant.edu>:
>
> Hello,
>
> I have been trying to use the Gnuplot1.7.py module, but it doesn't seem to
> 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 it
> doesn't
> seem to work.  Any ideas?
>
> #----------------------------
> import numpy
> import Numeric
> import Gnuplot
>
> g = Gnuplot.Gnuplot(debug=1)
> dh=.1;
> x=numpy.arange(dh,2+dh,dh,'d')
> y1 = x**2
>
>
> y2=y1
>
> d1 = Gnuplot.Data(x, y1,
>                   title='numpy',
>                   with='points')  # doesn't work
> d2 = Gnuplot.Data(Numeric.asarray(x,'f'), Numeric.asarray(y2,'f'),
>                   title='Numeric',
>                   with='points')   # works
>
> g.plot(d1,d2)
>
> #----------------------------
>
>
>
>
>                         thanks,
>
>                                 bb
>
> --
> -----------------
>
>              bblais at bryant.edu
>              http://web.bryant.edu/~bblais<http://web.bryant.edu/%7Ebblais>
>
>
> -------------------------------------------------------
> 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=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060211/0fe04e4a/attachment.html 


More information about the Numpy-discussion mailing list