ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 03 Sep 2013 13:30:10 +0200How can I do my matplotlib 3D graph can be rotated everybody using jmol?https://ask.sagemath.org/question/10494/how-can-i-do-my-matplotlib-3d-graph-can-be-rotated-everybody-using-jmol/Hello!
How can I do my matplotlib 3D graph can be rotated everybody using jmol?<br>
For example I created 3D graph using matplotlib:
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
X, Y, Z = axes3d.get_test_data(0.01)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
plt.savefig('1.png')
plt.show()
But created graph is only picture becase I used plt.savefig. But I want to rotate 3D graph. I have many graphs with experimental (not analitical formulae) data, but plot3d is only for analitical surfaces.
Please help me. Thanks.Sun, 01 Sep 2013 14:42:59 +0200https://ask.sagemath.org/question/10494/how-can-i-do-my-matplotlib-3d-graph-can-be-rotated-everybody-using-jmol/Answer by AndreWin for <p>Hello!
How can I do my matplotlib 3D graph can be rotated everybody using jmol?<br/>
For example I created 3D graph using matplotlib:</p>
<pre><code>from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
X, Y, Z = axes3d.get_test_data(0.01)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
plt.savefig('1.png')
plt.show()
</code></pre>
<p>But created graph is only picture becase I used plt.savefig. But I want to rotate 3D graph. I have many graphs with experimental (not analitical formulae) data, but plot3d is only for analitical surfaces.
Please help me. Thanks.</p>
https://ask.sagemath.org/question/10494/how-can-i-do-my-matplotlib-3d-graph-can-be-rotated-everybody-using-jmol/?answer=15404#post-id-15404It seems I found the answer ^_^ <br>
I should use list_plot3d command.Mon, 02 Sep 2013 03:52:13 +0200https://ask.sagemath.org/question/10494/how-can-i-do-my-matplotlib-3d-graph-can-be-rotated-everybody-using-jmol/?answer=15404#post-id-15404Comment by ppurka for <p>It seems I found the answer ^_^ <br/>
I should use list_plot3d command.</p>
https://ask.sagemath.org/question/10494/how-can-i-do-my-matplotlib-3d-graph-can-be-rotated-everybody-using-jmol/?comment=17076#post-id-17076You probably should be aware of the egregious behavior of `list_plot3d` I attempted to fix in ticket 12798. Only the last two hunks of the first patch are needed for the fix.Tue, 03 Sep 2013 13:30:10 +0200https://ask.sagemath.org/question/10494/how-can-i-do-my-matplotlib-3d-graph-can-be-rotated-everybody-using-jmol/?comment=17076#post-id-17076