NotImplementedError:Axes3D 目前仅支持方面参数“auto”。您通过了“平等”

问题描述 投票:0回答:1

我正在关注本教程

我尝试运行这些代码:

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'

对于解决这个问题有什么建议吗? 这是因为我的环境吗?我的软件包版本导致问题?

python-3.x matplotlib matplotlib-basemap
1个回答
0
投票

我遇到了同样的问题,并通过在

fix_aspect=Flase
中添加
Basemap
来修复它,如下所示。

map = Basemap(fix_aspect=False)
© www.soinside.com 2019 - 2024. All rights reserved.