困惑的研究生在这里。我希望为加拿大各省添加行,方法与ax.add_feature(feature.STATES)
行相同,但仅针对各省。有人知道怎么做吗?我在下面附上了我的代码和它生成的地图
fig, ax = plt.subplots(1, 1, figsize=(10,8))
ax = plt.axes(projection=ccrs.PlateCarree())
ax.set_global()
ax.set_extent([-140,-60,40,75], crs=ccrs.PlateCarree())
ax.coastlines()
ax.stock_img()
ax.set_xticks([-150, -140, -130, -120, -110, -100, -90, -80, -70, -60],crs=ccrs.PlateCarree())
ax.set_yticks([75, 70, 65, 60, 55, 50, 45],crs=ccrs.PlateCarree())
ax.add_feature(feature.BORDERS)
ax.add_feature(feature.STATES)
ax.set_title('Map of Areas with Projected Viable Summer Temperatures in 2020', size = 'xx-large')
ax.add_feature(feature.LAND)
ax.add_feature(feature.COASTLINE)
# plot data
pc = ax.pcolormesh(lon,lat,tempsummer2020viable,cmap="OrRd")
cax,kw = mpl.colorbar.make_axes(ax,location='bottom',pad=0.05,shrink=0.7)
out=fig.colorbar(pc,cax=cax,extend='both',**kw)
out.set_label('Temperature Within Viable Limit (°C))',size=10)
下面是绘制加拿大地图的示例代码,该地图具有一些基本特征,包括省边界和示例专题图层
以及样本地图:
相关问题 更多 >
编程相关推荐