- 积分
- 93
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2024-1-23
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
通过set_clip_path来mask时,出现了图形超出边框的情况,应该怎么解决?
代码:
shp = shapereader.Reader(maindir + 'china_boundary.shp')
geo_list = list(shp.geometries())
path = Path.make_compound_path(*geos_to_path(geo_list))
ax.add_geometries(shp.geometries(), proj, facecolor='none', edgecolor='k',linewidth=0.4)
cc = ax.contourf(lon, lat, data, zorder=0, extend='both', cmap=cmaps.BlueWhiteOrangeRed_r,
levels=np.arange(-6.3,6.3+0.3,0.3),transform=proj)
for col in cc.collections:
col.set_clip_path(path, transform=ax.transData)
图片: |
|