From: Felix U. <fel...@ui...> - 2010-04-21 11:59:44
|
Hi there, i have following problem: i want to plot a number of lines. The number of lines can be set by an user option, so i don't know it in advance. I thought of using a list of Data PlotItems. Establishing the PlotItem list works, however sending it to g.plot fails. Any idea how to do this/ work around it. Here's a testcode to illustrate what i mean: 1 import Gnuplot 2 from numpy import * 3 4 g = Gnuplot.Gnuplot(persist=1) 5 g('set terminal x11 size 1000,680') 6 7 y = [] 8 y.append([1,2,3,4,5,6]) 9 y.append([1.1,2.1,3.1,4.1,5.1,6.1]) 10 11 ga =[] 12 ga.append(Gnuplot.Data(y[0],binary=0,with_='lines')) 13 ga.append(Gnuplot.Data(y[1],binary=0,with_='lines')) 14 15 16 # --- This of course works--- 17 #g.plot(ga[0],ga[1]) 18 19 # --- This is what i want to work :-) --- 20 g.plot(ga) Looking forward to your answers! regards, Felix |