From: <al...@mm...> - 2006-01-10 08:32:05
|
> 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? I expect to see surfaces by (x,y,z) coloured in function of val, i.e., if val is high I want to see the point in yellow and if it is low in black. > 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. How do I know it? I tried with set & unset hidden3d, but it looks like the same... > > 2. If your z values are all the same, then you would not see distinct > surfaces. You're right, but they aren't the same > 3. Try the same thing without the inline=1 option. Does that work? > (This would imply a Gnuplot.py bug.) It works the same. > 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? No, it does the same... ;P > Michael In fact I can see the points colored typping splot "temp.plot" using 1:2:3:4 with points pointtype 7 palette but with no surface... (temp.plot is a file with the same data) Maybe I shoud read the entire gnuplot tutorial... but I find it really boring... ;) thank you very much! Albert ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ |