I'm using gnuplot to draw a cone with an arrow pointing upwards through the cone's axis of symmetry. The only problem is that I can't figure out how to fit the arrow correctly into the 3D perspective of the picture. By default, the arrow is displayed behind the entire cone. If I add the "front" option to the arrow, it is displayed in front of the entire cone. But, viewed in perspective, the arrow should be in front of the back half of the cone, and behind the front half of the cone.
The obvious solution is to split the function drawing the cone into two halves and make the arrow in front of one curve and behind the other. Is there a way to do that (i.e., manually set the order in which curves and other objects are drawn)? If not, does anyone have a good workaround? (The only one I can think of is to draw the arrow manually using lines, but I'd like to avoid that if possible.)
Here is a minimal working example. I'm using a fine mesh so that the effect is clearly visible.
set arrow 1 from 0,0,0 to 0,0,1 lw 2
set isosamples 100
set xrange [-1:1]
set yrange [-1:1]
set zrange [-1:1]
set zrange [0:1]
splot sqrt(x**2+y**2)
To see what's wrong with simply using the "front" option as a fix, replace the first line with:
set arrow 1 from 0,0,0 to 0,0,1 lw 2 front
Thanks in advance for any help!
Edit: I realized after posting that this can be done with multiplot. But it seems like there should be a better solution, so please let me know if you think of one.