Skip to content

Basemap with Mplot3d Objects #185

@essandess

Description

@essandess

I'm trying to use basemap globes as 3d objects along with other 3d plots with mplot3d, but basemap is throwing the following errors.

Example code:

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

bmap = Basemap(projection='ortho',lat_0=35,lon_0=68,resolution='l')

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

ax.set_axis_off()
# ax.add_collection3d(bmap.bluemarble())
ax.add_collection3d(bmap.drawcoastlines(linewidth=0.25))
ax.add_collection3d(bmap.drawcountries(linewidth=0.35))

plt.show()

Error:

AttributeError: 'Ellipse' object has no attribute 'do_3d_projection'

Uncommenting basemap's bluemarble() function throws the error

AttributeError: 'AxesImage' object has no attribute 'get_datalim'

Is there any way to treat basemap plots as 3d objects? I have something like this cartopy example in mind, except with 3d globe plotting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions