From: Nate G. <gel...@tr...> - 2003-11-06 22:53:06
|
Hi, I have a database query that returns a variable length list of hosts for which I want to plot some data about. How can I pass Gnuplot.plot a list of Gnuplot.Data types? In the past I knew how may lines I had on the graph so I could just pass g.plot(gd1,gd2,gd3,gd4) .... how do I=20 make a variable length variable list? I was trying this but got a TypeError: bad argument type for built-in operation plot_list =3D [] for i in res.keys(): print i x =3D Numeric.arange(len(res[i]),typecode=3DNumeric.Float) y =3D Numeric.zeros(len(res[i])) for j in range(0,len(res[i])): line =3D res[i] y[j] =3D line[j][0] gd =3D Gnuplot.Data(x,y,title=3Di,smooth=3Dsmoothtype) plot_list.append(gd) g.plot(plot_list) Thanks, --( Nate Gelbard, QA Engineer =20 --( Tripwire, Inc., The Integrity Assurance Company |