From: manuel a. <al...@gm...> - 2011-02-13 11:43:54
|
Following crashes, === ... >>> gp = Gnuplot.Gnuplot(persist = 1) >>> gp('set xdata time') >>> gp('set timefmt "%Y-%m-%d"') >>> data = [['2010-01-01',1] ['2010-02-02',2]] >>> plot1 = Gnuplot.PlotItems.Data(data, with_="lines") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/dist-packages/Gnuplot/PlotItems.py", line 549, in Data data = utils.float_array(data[0]) File "/usr/lib/python2.6/dist-packages/Gnuplot/utils.py", line 33, in float_array return numpy.asarray(m, numpy.float32) File "/usr/lib/python2.6/dist-packages/numpy/core/numeric.py", line 230, in asarray return array(a, dtype, copy=False, order=order) ValueError: setting an array element with a sequence. I read that it is known issue, the communication between python and native gnuplot works with passing arrays. In my case they don't have expected pattern/structure. Does somebody know workaround so it works directly in python script? Currently I spit out .csv data to file and then "natively" plot it under gnuplot console. I am using gnuplot.py 1.8-1.1 with transitive dep to numpy 1.3.0. thanks. -- manuel aldana al...@gm... software-engineering blog: http://www.aldana-online.de |