【发布时间】:2019-03-05 21:54:57
【问题描述】:
我无法在 Zeppelin 的 python 中获取以下代码的输出:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = Axes3D(fig)
x = list(range(0, 100))
y = list(range(0, 100))
z = list(range(0, 100))
ax.scatter(x, y, z)
plt.show()
错误是:
执行第 10 行失败:ax.scatter(x, y, z)
AttributeError: 'PathCollection' 对象没有属性 'do_3d_projection'
一般情况下,scatter 在 Zeppelin 的 python 中不起作用并出现上述错误。另外,this solution 不适合我。
【问题讨论】:
-
您的代码对我来说很好用。我只需要将
pyplot.show()替换为plt.show() -
@Bazingaa 谢谢。这不是我的问题。这是一个错字。错误是分散的。
-
你的意思是,
ax = fig.gca(projection='3d')也不起作用?看起来很像是 zeppelin 的问题。 -
@ImportanceOfBeingErnest 我的意思是上面的代码有提到的错误。错误出现在
as.Scatter。那么,解决办法是什么?
标签: python matplotlib apache-zeppelin