【发布时间】:2022-02-02 01:01:07
【问题描述】:
我正在尝试使用 cartopy 在北极立体投影中绘制海冰等高线,但有一种奇怪的行为,即等高线不会以 180 度环绕。我查看了另一篇帖子 (Strange behavior with contours in Cartopy polar stereographic plot),该帖子建议将我的经度更改为 0-360,但如果我这样做,我会遇到同样的问题,但经度为 0 而不是 180。
(使用相同的数据,我在使用底图时从未遇到过这个问题)
sea_ice, LO 和 LA 是大小为 (448, 304) 的矩阵,最重要的是,LA 和 LO 的 lat 和 lon 间隔不规则,它是极坐标投影,所以我不能使用 add_cyclic_point。
这是我的绘图代码:
fig = plt.figure(figsize=(8,8))
ax = plt.axes(projection=cartopy.crs.NorthPolarStereo(true_scale_latitude=70))
gl = ax.gridlines(draw_labels=True)
gl.xlabel_style = {'size': 16,'rotation':0}
ax.coastlines('10m')
ax.add_feature(cfeature.RIVERS)
ax.set_extent([-180, 180, 55, 90], crs=cartopy.crs.PlateCarree())
ax.add_feature(cfeature.LAND, facecolor = '0.75')
ax.add_feature(cfeature.RIVERS,facecolor='blue')
cc=plt.contour(LO, LA, sea_ice, levels=[15], colors='m', linewidth=3, transform=cartopy.crs.PlateCarree())
【问题讨论】: