I have plotted a sphere using gnuplot in parametric mode. I am trying to plot 3d data from a file, which will surround the sphere. It seems that the points with overlap with the sphere are hidden even though they should be in front of the shape.
Here's my script:
unset border
unset colorbox
unset key
unset tics
set view equal
set isosamples 64
set pm3d depthorder interpolate 0,0
set palette rgb 3,3,3
set parametric
r = 19
splot 'saturn.txt' linecolor rgb 'black', \
r*sin(u)*cos(v) + 40, r*sin(u)*sin(v) + 40, r * cos(u) + 40.5 w pm3d
The image below shows my problem. On the left is the full set of data plotted without the sphere. In the middle it can be seen that there are points missing from in front of the sphere. The view on the right shows that these points are definitely in front of the sphere. Is there any way I can plot both at the same time without the points in front of the sphere being hidden?

I found the answer, in this gnuplotting article:
set hidden3d front
Why exactly that works is a mystery to me. I couldn't find anything relevant in the gnuplot manual about it.
Here's the final plot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With