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'
有什么建议可以解决这个问题吗?这是因为我的环境,我的软件包版本造成的问题吗?
1条答案
按热度按时间3vpjnl9f1#
我遇到了同样的问题,并通过在
Basemap
中添加fix_aspect=Flase
来修复它,如下所示。