在极坐标图中轮廓超过 0 点时 tricontourf 中断

tricontourf breaking when contouring over 0 point in polar plot

我正在尝试在极坐标图上绘制 tricontourf,但是在 0 经度点上绘制时似乎出现故障。

在绘制散点图时很明显,这些点都很好。

此外,当在其他不包含 0 经度的位置绘制 tricontourf 时,它工作得很好。

这里分别是 tricontourf 和散点图的代码:

    axes.tricontourf(prediction['Longitude'], prediction['Latitude'], prediction['Measurement'], levels = np.linspace(0, 2, 50), cmap='viridis', zorder=10)
    axes.scatter(prediction['Longitude'], prediction['Latitude'], c=prediction['Measurement'], cmap='viridis', zorder=10, norm = plt.Normalize(0, 2),s=10)

此外,here are the data points centred on 0 lon, 62 lat and these are the ones centred on -90 lon, 62 lat.

有人知道为什么会这样吗?

对于任何想知道的人:解决方案是将经度从 0-360 转换为 -180-180。我通过以下两行代码实现了这一点:

prediction['Longitude'] = (prediction['Longitude'] + 180) % 360 - 180
prediction = prediction.sort_values('Longitude')