【发布时间】:2012-12-18 14:34:25
【问题描述】:
您好,有谁知道是否有办法将 matplotlib 3d 旋转图保存为允许它们仍然旋转的格式?也许是一个特定的程序?
代码是:
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
我不确定是否确实存在执行此操作的程序,但如果有人知道它会非常有帮助。谢谢。
【问题讨论】:
-
也许腌一下,然后你可以在另一个python会话中重新打开。
-
嗨,我最终将地块腌制并重新加载,但重新加载的地块不旋转。 :( 有没有人在这方面取得了成功,或者我在做什么?
-
抱歉,经过进一步考虑(和任何测试),现在这似乎是个坏主意(我什至无法将
figure对象放入pickle)。 -
这正是我想要的。你有没有运气找到一种方法来做到这一点?
标签: python-2.7 matplotlib