From: Michael H. <mh...@al...> - 2006-01-06 07:42:07
|
al...@mm... wrote: > I want to use gnuplot.py to represent several "4D" surfaces in the same plot, so > I write something like: > > data1 = [ > [ > [1,1,z1(1,1),val1(1,1)], > [1,2,z1(1,2),val1(1,2)], > [1,3,z1(1,3),val1(1,3)], > ], > [ > [2,1,z1(2,1),val1(2,1)], > [2,2,z1(2,2),val1(2,2)], > [2,3,z1(2,3),val1(2,3)], > ], > ... > ] > > data2 = [ > [ > [1,1,z2(1,1),val2(1,1)], > [1,2,z2(1,2),val2(1,2)], > [1,3,z2(1,3),val2(1,3)], > ], > [ > [2,1,z2(2,1),val2(2,1)], > [2,2,z2(2,2),val2(2,2)], > [2,3,z2(2,3),val2(2,3)], > ], > ... > ], > > ... > > dataN = ... > > and then, data = [Gnuplot.Data(data1, using=(1,2,3,4), inline = 1), > Gnuplot.Data(data2, using=(1,2,3,4), inline = 1), > ... > Gnuplot.Data(dataN, using=(1,2,3,4), inline = 1)] > > So, when I go to plot: > g = Gnuplot.Gnuplot(debug = 1) > g.splot(*data) > > it seems something works because you can read: > gnuplot> splot '-' using 1:2:3:4 notitle, '-' using 1:2:3:4 notitle, '-' using > 1:2:3:4 notitle, '-' using 1:2:3:4 notitle, '-' using 1:2:3:4 notitle > on your terminal, but only the last surface is plotted, maybe because the > (x,y) pairs are the same in data1, data2, ... > > So, how can I solve this? > My target is to see all the 3D points in different colors or something like > that... do you understand? I'm a bit out of practice. How do you expect the four values to be used? Usually splot uses (x,y,z) triplets, no? Otherwise I don't see why this shouldn't work. I can't imagine that it would be a problem that the (x,y) pairs are the same. Ideas: 1. If you have hidden line removal on (which is the default, I think) it could be that all of your surfaces are being plotted but the top surface is visually obscuring the other surfaces. 2. If your z values are all the same, then you would not see distinct surfaces. 3. Try the same thing without the inline=1 option. Does that work? (This would imply a Gnuplot.py bug.) 4. Try a simple example with "naked" gnuplot, rather than Gnuplot.py, using temporary files to hold the data. Does it do what you expect? Michael |