【发布时间】:2019-10-06 21:38:49
【问题描述】:
执行这行代码时:
import matplotlib.pyplot as plt
#your code
fig = plt.figure()
ax = fig.gca(projection='3d')
我有一个输出错误:
raise ValueError("Unknown projection %r" % projection)
ValueError: Unknown projection '3d'
<Figure size 432x288 with 0 Axes>
当我使用 Spyder 作为 IDE 时也会出现该错误。
matplotlib的版本是
print('matplotlib: {}'.format(matplotlib.__version__))
matplotlib: 1.5.0rc3
但即使使用其他版本的matplotlib,我也遇到了同样的问题。
this question (Stackoverflow) 中报告了类似的错误,但答案无济于事。关于如何修改指令的一些建议?
matplotlib:3.0.2
【问题讨论】:
标签: python matplotlib 3d conda spyder