Hi all!
I have started using gnuplot.py very recently, and my only learning has been
through 'gnuplot>help' and google>gnuplot.py.
I am trying to plot daily statistics for my utility. I have datetime objects
coming from the db alongwith other fields. I want to use the dates on the
xaxis. I tried to do something like the following:
a) extract dates from the records in the form of a list, say DL.
b) convert DL to an array: dArray = array(DL)
c) myPlot = Gnuplot.Data(dArray, anotherArray, title='x')
but it gives the following error:
* myPlot = Gnuplot.Data(dArray, anotherArray, title='x')
** File "/usr/lib/python2.4/site-packages/Gnuplot/PlotItems.py", line
526, in Data
set = utils.float_array(set)
File "/usr/lib/python2.4/site-packages/Gnuplot/utils.py", line 38, in
float_array
return Numeric.asarray(m, Numeric.float32)
File
"/usr/lib64/python2.4/site-packages/numpy/oldnumeric/functions.py", line
87, in asarray
return mu.array(a, dtype, copy=0)
ValueError: setting an array element with a sequence.
*
I have ensured that the length of both the arrays are same. The only thing
which is different si that for dArray it shows dType=|S10, while for
'anotherArray' it doesnt show any dType.
Any help is much appreciated.
Thanks
Ajay
|