I am trying to plot a wave function over one dimension that has both real and imaginary parts. I have created an animation of the 3D plot as shown in the screenshot below:
I would like to spread the plot along the x-axis (which currently is vertical) and set it up with a set of 3 RGB axes that intersect at (0,0,0). I have included the code I am using to animate the plot below:
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import mpl_toolkits.mplot3d.axes3d as p3
fig = plt.figure()
ax = fig.gca(projection='3d')
line, = ax.plot(REAL[0,:],IMAG[0,:],x,"r",linewidth=0.5)
def animacio(i):
ax.collections.clear()
line.set_data(REAL[i,:],IMAG[i,:])
line.set_3d_properties(x, 'z')
return line,
ani = animation.FuncAnimation(fig,animacio,interval=50, frames=Nt,repeat=True)
nom = 'Evolució_'
ani.save(str(nom)+'['+str(V0)+','+str(L)+','+str(l)+','+str(xi)+','+str(sigmax)+','+str(T)+']'+'.mp4', writer="ffmpeg", dpi=300)
plt.show()
print('Animation saved as: '+str(nom)+'['+str(V0)+','+str(L)+','+str(l)+','+str(xi)+','+str(sigmax)+','+str(T)+']'+'.mp4')
I am looking for a way to spread the plot along the x-axis and set it up with 3 RGB axes that intersect at (0,0,0). Is there a straightforward way to do this?