When using set pm3d map
it seems that depthorder
is ignored.
Consider the following example:
set samples 100 set isosamples 100 set xrange [-3:3] set yrange [-3:3] set size square c(x,y,m) = exp(-((sqrt(x**2+y**2)-m)**2)/0.1) set pm3d depthorder splot c(x,y,1) w pm3d, c(x,y,2) w pm3d
This gives a plot with two rings, see attachment.
However, when using set pm3d map depthorder
, only the last ring remains like depthorder
is ignored.
I think this constitutes a feature request rather than a bug.
The sort order in "set pm3d depth" really is depth, i.e. distance from the viewer, not z. If applied to either the top or the bottom projection ("set pm3d at tb") this would only guarantee that the far-away corner is rendered before the closest-to-the viewer corner. "set view map" or "set pm3d map" act by showing the bottom projection face-on. The z-coordinates have been collapsed to z=0 so sorting on z wouldn't help at this stage. You'd have to sort everything on the original z value (not the effective z value after rotation) at some earlier step. And/or you'd have to add a field to the relevant structures like gpdPoint and gpiPoint to hold the original z in addition to the rotated z.
None of that is to say that we couldn't change the code so that projections are rendered in z-coodinate order even though the surface is rendered in visual depth order. Or one might add a new option "set pm3d zorder". But that would be a new feature, not a bugfix for the existing documented behavior.
Thanks for your answer.
I'm not familiar with the pm3d code. I thought, that the depthorder is applied before actually performing the
pm3d map
projection like when usingset view 0,0
. That's why I classified this behavior as bug.That's an interesting point. "set view 0,0" does do what you were expecting, right?
The question is whether it makes sense for "set view map" and "set pm3d map" to display the projection onto z=0 rather than displaying full the depth-sorted surface using view angles 0,0. I am not familiar with that code path either, so I would have to search aroung in it to see whether that would be possible.