“PathCollection”对象没有属性“do\u 3d_projection”

2024-06-06 12:19:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法从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()

错误是:

Fail to execute line 10: ax.scatter(x, y, z)

AttributeError: 'PathCollection' object has no attribute 'do_3d_projection'

一般来说,scatter不能在齐柏林的python中工作,并得到上面的错误。另外,this solution对我不起作用。在


Tags: 代码fromimportmatplotlibas错误figrange
1条回答
网友
1楼 · 发布于 2024-06-06 12:19:08

回答有点晚了。。。在

您可以尝试切换到pythonx64位。不要使用x86版本。 enter image description here 请记住在安装后编辑Python的路径优先级。另外,您可能需要在命令行中输入“python”进行验证。 enter image description here 此解决方案只适用于64位系统。不知道这个问题是否会发生在32位上。在

相关问题 更多 >