matplotlib NotImplementedError:Axes3D当前仅支持方面参数“auto”,您传入了“equal”

pokxtpni  于 2023-10-24  发布在  其他
关注(0)|答案(1)|浏览(364)

I was following this tutorial
我试着运行这些代码:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.basemap import Basemap

map = Basemap()

fig = plt.figure()
ax = Axes3D(fig)

'''
ax.azim = 270
ax.elev = 90
ax.dist = 5
'''

ax.add_collection3d(map.drawcoastlines(linewidth=0.25))
ax.add_collection3d(map.drawcountries(linewidth=0.35))

plt.show()

但是我得到了这些错误:

NotImplementedError: Axes3D currently only supports the aspect argument 'auto'. You passed in 'equal'.
AttributeError: 'LineCollection' object has no attribute 'do_3d_projection'

有什么建议可以解决这个问题吗?这是因为我的环境,我的软件包版本造成的问题吗?

3vpjnl9f

3vpjnl9f1#

我遇到了同样的问题,并通过在Basemap中添加fix_aspect=Flase来修复它,如下所示。

map = Basemap(fix_aspect=False)

相关问题