I'm trying to plot a line through a 3-D surface as a means of indicating the axis. However, this only results in the line being plotted entirely on top of or beneath the surface--changing the zorder
does not solve this.
What I'm looking for is for the line to appear as if it were piercing through the surface
My code and output are below:
fig = plt.figure(figsize=(9,9))
ax = plt.axes(projection='3d')
ax.plot_surface(X,Z,Y,
linewidth=0,
cmap=cm.jet,
facecolors=cm.jet(r_3d/max(abs(r_3d.flatten()))),
edgecolor='none',
shade=False,
antialiased=False)
ax.plot([0,0],[-0.3,0.3],[0,0],linewidth=2,c='k')
Example of line plotted on top of surface
Hand drawn example of my desired output