I'm trying to plot a plane over a plot without having the main plot out of scale or overwritten. Ideally what I want is to aid visualization of a potential barrier in the complex visualization of a wave function, this could be done by somehow creating a shaded volume between the region of the potential... I thought I could make two planes for this purpose but they are plotted taking out of sight my main plot. This are two pictures of my resulting plots without and with the planes that I tried respectively:
I think I may be overwritting the main plot but I can't find a clear solution to this problem, this is the code I'm using to make the plot and an animation(If needed I can share the whole code):
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as animation
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.get_proj = lambda: np.dot(Axes3D.get_proj(ax), np.diag([1.5, 0.7, 0.7, 1]))
line,=ax.plot(x,IMAG[0,:],REAL[0,:],"r",linewidth=0.5)
ax.set_xlabel('Posició (nm)')
ax.set_ylabel('$Im[\psi(x,t)]$')
ax.set_zlabel('$Re[\psi(x,t)]$')
#Here are the two planes
yy, zz = np.meshgrid(range(-2,2), range(-2,2))
ax2 = plt.subplot(projection='3d')
ax2.plot_surface(-l, yy, zz,color='b',alpha=0.2)
ax2.plot_surface(l, yy, zz,color='b',alpha=0.2)
def animacio(i):
ax.collections.clear()
line.set_data(REAL[i,:],IMAG[i,:])
line.set_3d_properties(x, 'x')
return line,
ani=animation.FuncAnimation(fig,animacio,interval=50, frames=Nt,repeat=True)
ani.save(f'Evolució_[{V0},{L},{l},{xi},{sigmax},{T}].mp4', writer="ffmpeg", dpi=300)
plt.show()