Skip to content
Advertisement

tricontourf breaking when contouring over 0 point in polar plot

I am trying to plot a tricontourf on a polar plot, however it seems that it glitches out when plotting over the 0 longitude point.

glitched

It’s clear when plotting as a scatter plot that the points are just fine. not glitched

Furthermore, when plotting the tricontourf in other locations not containing 0 longitude it works just fine. not glitched 2

Here is the code for the tricontourf and scatter plot respectively:

JavaScript

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

Does anyone know why this is happening?

Advertisement

Answer

To anyone wondering: the solution is to convert the longitudes from 0-360 to -180-180. I achieved this by the following two lines of code:

JavaScript

fixed

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement