【问题标题】:Saving the matplotlib 3d rotating plots保存 matplotlib 3d 旋转图
【发布时间】: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


【解决方案1】:

我认为 matplotlib 做不到。 我找到的解决方案是制作图表以在浏览器中显示它们。例如使用plot.ly

一个例子:https://plot.ly/python/ipython-notebook-tutorial/#3d-plotting

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-28
    • 1970-01-01
    • 2018-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多