我需要将一个可旋转的3D绘图导出到HTML,就像WriteWebGL does in R,但是要从Python/matplotlib导出
在Jupyter笔记本中运行时,您可以生成如下交互式绘图:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
...
ax.scatter3D(xdata, ydata, zdata, c=zdata, cmap='Greens');
(此示例的源代码here)
如前所述,用户可以旋转3D绘图。如何从Python中将这种交互性导出为HTML
它必须是matplotlib吗?你可以用plotly来做这件事
下面是一个简单的例子。这将修改名为test.html的现有空文件,然后可以在web浏览器中打开该文件以使用交互式三维打印
相关问题 更多 >
编程相关推荐