Ryan
Ryan

Reputation: 416

NotImplementedError: Axes3D currently only supports the aspect argument 'auto'. You passed in 'equal'

I was following this tutorial

I tried to run these codes:

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()

However I have gotten these error:

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

Any suggestions in resolving this? Is this because of my environment; my packages versions causing issues?

Upvotes: 0

Views: 2065

Answers (1)

tyoyo
tyoyo

Reputation: 11

I faced the same issue and fixed it by adding fix_aspect=Flase in Basemap as below.

map = Basemap(fix_aspect=False)

Upvotes: 1

Related Questions