OK so I am piping data into GNUplot in the form of, e.g:
2013-11-04 20:00:12,875,350,112,29,38,4,44,10,632,121
I have set the following in my Python code:
gnuplot.stdin.write("plot '-' u 1:2 t 'aa',\
'' u 1:3 t 'aa in',\
'' u 1:4 t 'bb',\
'' u 1:5 t 'bb in',\
'' u 1:6 t 'cc',\
'' u 1:7 t 'cc in',\
'' u 1:8 t 'dd',\
'' u 1:9 t 'dd in',\
'' u 1:10 t 'ee';\n")
However I keep getting errors such as:
gnuplot> plot '-' u 1:2 t 'aa', '' u 1:3 t 'aa in', '' u 1:4 t 'bb', '' u 1:5 t 'bb in', '' u 1:6 t 'cc', '' u 1:7 t 'cc in', '' u 1:8 t 'dd', '' u 1:9 t 'dd in', '' u 1:10 t 'ee';
^
line 1271: warning: Skipping data file with no valid points
Any ideas?
###UPDATE:###
Based on @Christoph's feedback; here's the code I'm currently using:
cur.execute(sql)
data = cur.fetchall()
c = 0
for k in data:
dataElement = data[c]
gnuplot.stdin.write("plot '-' u 1:2 t 'aa',\
'' u 1:3 t 'aa in',\
'' u 1:4 t 'bb',\
'' u 1:5 t 'bb in',\
'' u 1:6 t 'cc',\
'' u 1:7 t 'cc in',\
'' u 1:8 t 'dd',\
'' u 1:9 t 'dd in',\
'' u 1:10 t 'ee';\n")
gnuplot.stdin.write("%s,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i\n" % dataElement[:])
gnuplot.stdin.write("e\n")
c = c + 1
gnuplot> plot '-' u 1:2, '' u 1:3, '' u 1:4, '' u 1:5, '' u 1:6, '' u 1:7, '' u 1:8, '' u 1:9, '' u 1:10;