We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
对于裁剪后裁剪内容超出 Axes的情况(#97、#99、#111) 添加 contours.set_clip_box(ax.bbox) 即可解决。以文档中的 剪切地图 为例
Axes
contours.set_clip_box(ax.bbox)
测试代码为
import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs from cnmaps import get_adm_maps, clip_contours_by_map, draw_map from cnmaps.sample import load_dem lons, lats, data = load_dem() fig = plt.figure(figsize=(10, 10)) ax = fig.add_subplot(111, projection=ccrs.PlateCarree()) ax.set_extent([70, 140, 40, 55], crs=ccrs.PlateCarree()) map_polygon = get_adm_maps(country='中华人民共和国', record='first', only_polygon=True) cs = ax.contourf(lons, lats, data, cmap=plt.cm.terrain, levels=np.linspace(-2800, data.max(), 10), transform=ccrs.PlateCarree()) clip_contours_by_map(cs, map_polygon) draw_map(map_polygon, color='k', linewidth=1) plt.show()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
对于裁剪后裁剪内容超出
Axes
的情况(#97、#99、#111)添加
contours.set_clip_box(ax.bbox)
即可解决。以文档中的 剪切地图 为例测试代码为
The text was updated successfully, but these errors were encountered: