- 积分
- 368
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-3-13
- 最后登录
- 1970-1-1
![[sssss_61579] 粉丝数:1 微博数:1 新浪微博达人勋](source/plugin/sina_login/img/light.png)
|

楼主 |
发表于 2022-1-4 11:20:44
|
显示全部楼层
proj = ccrs.PlateCarree()
fig = plt.figure() # 创建画布
ax = fig.add_subplot(1, 1, 1, projection=proj) # 创建子图
ax.coastlines()##绘制默认海岸线
ax.add_feature(cfeature.LAND)####添加陆地######
ax.add_feature(cfeature.COASTLINE,lw=0.3)#####添加海岸线#########
ax.add_feature(cfeature.RIVERS,lw=0.25)#####添加河流######
ax.add_feature(cfeature.LAKES)######添加湖泊#####
ax.add_feature(cfeature.OCEAN)######添加海洋########
extent=[-180,180,-90,90]##经纬度范围
gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True, linewidth=0.2, color='k', alpha=0.5, linestyle='--')
gl.xlabels_top = False ##关闭上侧坐标显示
gl.ylabels_right = False ##关闭右侧坐标显示
gl.xformatter = LONGITUDE_FORMATTER ##坐标刻度转换为经纬度样式
gl.yformatter = LATITUDE_FORMATTER
#gl.xlocator = mticker.FixedLocator(np.arange(extent[0], extent[1], 30))
#gl.ylocator = mticker.FixedLocator(np.arange(extent[2], extent[3], 30))
lon_new, lat_new = np.meshgrid(lon, lat)
cf = ax.contourf(lon_new, lat_new, sst_all_sdd, cmap='RdBu_r', transform=proj)
plt.colorbar(cf)
plt.show() |
|