我想向非python用户发送Matplotlib交互式3D图,以便他们可以旋转和放大/缩小图形。 例如,下面的代码生成一个简单的3D条形图,但是如果未安装Python,则无法读取。
我尝试使用PyInstaller进行编译,并使用mpld3函数(获取TypeError:ndarray类型的对象不是JSON可序列化),并使用前一个线程({{ 3}})。
''''
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111,projection='3d')
xpos = [1,2,3,4,5,6,7,8,9,10]
ypos = [2,1,2]
zpos = [0,0]
dx = [1.0,1.0,1.0]
dy = [1.0,1.0]
dz = [1,10]
ax1.bar3d(xpos,ypos,zpos,dx,dy,dz,color = '#00ceaa')
plt.show()
''''