1
votes

I want to plot a surface where each face has a different pm3d style. I tried the following:

reset
set format x "%.6f"
set format y "%.6f"
set format z "%.6f"
set xrange[-10:10]
set xtics border -10,5,10
set yrange[-10:10]
set ytics border -10,5,10
set cbrange[0:2]
set pm3d depthorder
set palette defined (0 'green', 1 'red', 1 'blue', 2 'black')
splot "pm3d1_1.dat" using 1:2:3:($3/200) with pm3d, "pm3d1_1.dat" using 1:2:($3-1):($3/200+1) with pm3d

where 'pm3d1_1.dat' is the function z=xx+yy with z varying between 0 and 200 (x,y between -10 and 10). The problem is that the output doesn't look how I expected when viewed from certain points of view, like this one:

I'd appreciate any help and I'd like to know if there is an alternative to plot a surface with different pm3d styles on each face. Thanks.

1

1 Answers

1
votes

I guess it has to with the way depthorder sorts the quadrangles. Don't know if this could be fixed. To extend your question, here is an example without external data file, which also shows the problem:

set xrange[-10:10]
set yrange[-10:10]
set zrange[-1:200]
set isosamples 20
set pm3d depthorder
set ticslevel 0
set view 65,28
set palette defined (0 'green', 1 'red', 1 'blue', 2 'black')
splot '++' using 1:2:(z=$1**2+$2**2):(z/200.0) w pm3d,\
      '++' using 1:2:(z=$1**2+$2**2, z-1):(z/200.0+1) w pm3d

Result (with 4.6.4):

enter image description here

Don't know of any other way to plot this. Maybe I'll submit the above script as bug report.