#代码绘制等值线出现了两条线,进行修改之后正多边形的线还是不能消除

代码如下:
绘制海冰浓度
im = ax.scatter(valid_lons, valid_lats, c=valid_conc, cmap='Blues', norm=norm, transform=ccrs.PlateCarree())
添加颜色条
cbar = fig.colorbar(im, ax=ax, orientation='horizontal', pad=0.1, fraction=0.05)
cbar.set_label('Sea Ice Concentration')
查找等值线
contour_level = 0.15
contours = measure.find_contours(seaice_conc, contour_level)
选出最长的等值线
max_contour = max(contours, key=len)
转换轮廓坐标
contour_lons = transformed_lons[max_contour[:, 0].astype(int), max_contour[:, 1].astype(int)]
contour_lats = transformed_lats[max_contour[:, 0].astype(int), max_contour[:, 1].astype(int)]
绘制最长的等值线
ax.plot(contour_lons, contour_lats, transform=ccrs.PlateCarree(), color='red')
显示图形
plt.show()
读取的文件来自于nasa官网,链接如下:https://noaadata.apps.nsidc.org/NOAA/G02202_V4/south/daily/2019/