- 积分
- 2415
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-11-25
- 最后登录
- 1970-1-1

|

楼主 |
发表于 2018-11-26 14:28:47
|
显示全部楼层
或者:
- import numpy as np
- import matplotlib.pyplot as plt
- import cartopy as cart
- from mpl_toolkits.basemap import Basemap
- from netCDF4 import Dataset
- f = Dataset('sst.mnmean.nc')
- sst = f.variables['sst'][0,:,:]
- lats = f.variables['lat'][:]
- lons = f.variables['lon'][:]
- ax = plt.axes(projection=cart.crs.PlateCarree())
- ax.coastlines()
- ax.add_feature(cart.feature.LAND, zorder=100, edgecolor='k')
- ax.set_global()
- plot = ax.contourf(lons, lats, sst, 60, transform=cart.crs.PlateCarree())
- cb = plt.colorbar(plot)
- plt.show()
复制代码
改变cart.feature.LAND 为cart.feature.OCEAN,mask 海洋 |
|