您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

在Python中通过3D球面绘制圆柱地图数据

在Python中通过3D球面绘制圆柱地图数据

:这是使用cartopy的新版本,因为底图是EOL。以下是原始答案。

import matplotlib.pyplot as plt
import cartopy.crs as ccrs

img = plt.imread("/tmp/venuscyl4.tif")

plt.figure(figsize=(3, 3))

ax = plt.axes(projection=ccrs.Orthographic(-10, 45))
ax.gridlines(color='black', linestyle='dotted')
ax.imshow(img, origin="upper", extent=(-180, 180, -90, 90),
          transform=ccrs.PlateCarree())  # Important

plt.show()

使用Cartopy的金星地图

多亏了Raphael Roth的回答,我终于找到了我想要的东西:底图方法warpimage

这是一个非常小的例子。使用此金星柱形图,并根据菜谱简单示例

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
# set up orthographic map projection with
# perspective of satellite looking down at 50N, 100W.
# use low resolution coastlines.
# don't plot features that are smaller than 1000 square km.
bmap = Basemap(projection='ortho', lat_0 = 50, lon_0 = -100,
              resolution = 'l', area_thresh = 1000.)
# plot surface
bmap.warpimage(image='venuscyl4.jpg')
# draw the edge of the map projection region (the projection limb)
bmap.drawmapboundary()
# draw lat/lon grid lines every 30 degrees.
bmap.drawmeridians(np.arange(0, 360, 30))
bmap.drawparallels(np.arange(-90, 90, 30))
plt.show()
python 2022/1/1 18:34:46 有477人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶