From: Gerald R. <gd...@gm...> - 2008-07-28 16:41:59
|
Hello all, I appreciate the answer to one of the big questions last week. I am now experiencing some other difficulties and I sure could use some help. I am attempting to plot a set of sensor readings vs. time. I have a mock set of data, and I will show the error message I receive when I run it. Thank you again for the help! import Gnuplot g = Gnuplot.Gnuplot(debug=1) name = 'Plot.png' g('set term png') g('set out "' + name) g('set key outside') g('set xdata time') g('set timefmt "%m/%d/%Y"') g('set title "Yippy"') mylist = [ ('06/01/2000', 81.75), ('07/01/2000', 52.125), ('08/01/2000', 50.3125), ('09/01/2000', 61.3125), ('10/01/2000', 26.6875), ('11/01/2000', 19.4375), ('12/01/2000', 17), ('01/01/2001', 14.875), ('02/01/2001', 20.6875), ('03/01/2001', 17.8125), ('04/01/2001', 22.09), ('05/01/2001', 25.41), ('06/01/2001', 20.13), ('07/01/2001', 23.64), ('08/01/2001', 19.01)] plot = Gnuplot.PlotItems.Data(mylist, with="histeps", title="charlie") g.plot(plot) Now the error I receive is: Traceback (most recent call last): File "./graphictest.py", line 27, in <module> plot = Gnuplot.PlotItems.Data(mylist, with="histeps", title="charlie") File "/usr/lib/python2.5/site-packages/Gnuplot/PlotItems.py", line 513, in Data set = utils.float_array(set[0]) File "/usr/lib/python2.5/site-packages/Gnuplot/utils.py", line 41, in float_array return Numeric.asarray(m, Numeric.Float) File "/usr/lib/python2.5/site-packages/Numeric/Numeric.py", line 134, in asarray return multiarray.array(a, typecode, copy=0, savespace=savespace) TypeError: object of type 'float' has no len() I have attempted to debugg this myself and have been having no luck. I look at the 'float' has no len() and realize that their is some sort of casting error perhaps? Is it looking at the data points and assuming that they are strings? I am baffled. Thank you again for your help. Gerald Rude |