python画3d圆形图_在Python中用3D球体绘制圆柱形地图数据

更新:这是使用Cartopy的新版本,如

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

iCmIv.png

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

产生以下输出:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值