我是Python的新手,关于Cartopy能够在3D情节中使用的问题.以下是使用的示例matplotlibBasemap
.
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.basemap import Basemap
m = Basemap(projection='merc',
llcrnrlat=52.0,urcrnrlat=58.0,
llcrnrlon=19.0,urcrnrlon=40.0,
rsphere=6371200.,resolution='h',area_thresh=10)
fig = plt.figure()
ax = Axes3D(fig)
ax.add_collection3d(m.drawcoastlines(linewidth=0.25))
ax.add_collection3d(m.drawcountries(linewidth=0.35))
ax.add_collection3d(m.drawrivers(color='blue'))
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Height')
fig.show()
Run Code Online (Sandbox Code Playgroud)
这将在3D轴内创建一个贴图,以便您可以在曲面上绘制对象.但随着Cartopy回归matplotlib.axes.GeoAxesSubplot
.不清楚如何拍摄并添加到上面的3D图形/轴上matplotlib-basemap
.
那么,有人可以提供有关如何使用Cartopy进行类似3D绘图的任何指示吗?