Skip to content
New issue

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

使用国界shp裁剪等值线数据后无法zoom in #99

Open
hakurena opened this issue Jun 28, 2023 · 2 comments
Open

使用国界shp裁剪等值线数据后无法zoom in #99

hakurena opened this issue Jun 28, 2023 · 2 comments
Assignees

Comments

@hakurena
Copy link

想要达到的效果是白化中国国界线以外的区域,并且仅绘制100°E以东的地区,因此首先使用clip_contours_by_map裁剪数据,再通过set_extent设置了绘图范围,代码如下:

    # draw contours
    cs = ax.contourf(data_draw.coords['lon'],data_draw.coords['lat'],data_draw, 
                    cmap='Spectral_r', 
                    levels=levels, 
                    extend='both',
                    transform=proj) 
    # clip contour by map
    clip_contours_by_map(cs, map_polygon)
    ax.set_extent([100.,135,15.,55.])

绘图结果如下:
Snipaste_2023-06-28_15-29-57
最终使用salem裁剪数据+set_extent达到了目的,但由于是对数据进行裁剪,边缘非常粗糙。我尝试了不使用clip_contour_by_map,并不会出现数据溢出绘图范围的情况,想知道是什么原因导致了这个问题呢?

@Clarmy
Copy link
Member

Clarmy commented Jun 28, 2023

@hakurena 参考这个 issue:#97

@hakurena
Copy link
Author

hakurena commented Jun 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants