Hi does anyone know if there is a way of saving the matplotlib 3d rotating plots in a format which allows them to be still rotated? Perhaps a particular program?
Code is:
from numpy import *
import pylab as p
import mpl_toolkits.mplot3d.axes3d as p3
A=transpose(genfromtxt("Z:/Desktop/Project/bhmqntm-code/RichardsonRK4.csv", unpack=True, delimiter=','))
T=A[:,0]
X=A[:,1]
P=A[:,2]
fig=p.figure()
ax = p3.Axes3D(fig)
ax.scatter(X,P,T,s=1,cmap=cm.jet)
ax.set_xlabel('X')
ax.set_ylabel('P')
ax.set_zlabel('T')
p.show()#I would like this to be something like savefig('Z:/Desktop/Project/bhmqntm-code/plot3d_ex.png') but with a file ending of a program that would save the 3d capability
I'm not sure if a program which does this actually exists but if anyone knows of one it would be very helpful. Thanks.
MatPlotLib with PythonBy creating a 3D projection on the axis and iterating that axis for different angles using view_init(), we can rotate the output diagram.
1.2 Rotating the 3D Plot & Key Shortcuts. Click on the 3D plot window and drag the mouse on the plot. This should rotate the surface in the direction you move the mouse about the focus point (the origin, by default). To reset the viewpoint to the original one, press the Home key (fn-left arrow on Mac).
I do not think matplotlib can do it. The solution I found is to make graphs to display them in the browser. For example use plot.ly.
An example: https://plot.ly/python/ipython-notebook-tutorial/#3d-plotting
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