You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this is an issue or if it is not supported by GeoMakie, but plotting data where the longitude ranges from 0 to 360 degrees differ from the same data ranging from -180 degrees to 180 degrees.
using NCDatasets
using CairoMakie
using GeoMakie
# Get longitudes, latitudes, and mask data
nc =NCDataset("landsea.nc")
lat = nc["lat"][:]
lon = nc["lon"][:]
mask = nc["LSMASK"][:, :]
# Plot with longitudes ranging from 0 to 360 degrees
fig =Figure()
ax =GeoAxis(fig[1,1])
contourf!(ax, lon, lat, mask)
display(fig)
# Change longitudes to range from -180 to 180 degrees
lon[lon .>180] .-=360
sort_idx =sortperm(lon)
lon = lon[sort_idx]
mask = mask[sort_idx, :]
# Plot with longitudes ranging from -180 to 180 degrees
fig =Figure()
ax =GeoAxis(fig[1,1])
contourf!(ax, lon, lat, mask)
display(fig)
I get the following two images:
The second image is what I expected, but the first image is off. There is distortion at the top and bottom of the plot.
The text was updated successfully, but these errors were encountered:
I am not sure if this is an issue or if it is not supported by GeoMakie, but plotting data where the longitude ranges from 0 to 360 degrees differ from the same data ranging from -180 degrees to 180 degrees.
I am using
landsea.nc
from https://www.ncl.ucar.edu/Applications/Data/#cd and I ran the following scriptI get the following two images:
The second image is what I expected, but the first image is off. There is distortion at the top and bottom of the plot.
The text was updated successfully, but these errors were encountered: