"Residual" Grid Lines in Plot

Hallo, I am pretty new to GMT.jl and started using the recently. I tried to plot a world map based on a data set with lon lat and z-values using the following code:

# define grid
grd1 = xyz2grd(df1, region=(-180, 180, -60, 90), spacing=(0.1,0.1))

C = grd2cpt(grd1, 
    cmap=:turbo, 
    continuous = true
    )

grid = xyz2grd(df1, region=(-180, 180, -60, 90), spacing=(1.0,1.0))

grdimage(grid, 
    proj=:equidistCylindrical, 
    frame=:none, 
    cmap=C, 
    title = "test"
)
colorbar!(position=(outside=true, anchor=:MR), ylabel="kg", cmap=C)

# plot map
coast!(region=(-180, 180, -60, 90), shore  = 0.1, frame=:none, water="white", proj=:equidistCylindrical, savefig = string("test")*".pdf")

which returned the follwoing plot

for some reason there are still some grid lines on the ocean parts in the color of the colormap I am using persisting on the map. I tried to change the declaration of all arguments in different ways but yet these lines wont disapear. Has anyone an idea where they come frome and how I could supress them?

Thanks a lot in advance!

Hi,
A common mistake that people do with do with xyz2grd os to think that it is an grisd interpolator when it’s a reformater. I’m saying this because in your example you used two different increments when only one is possibly valid. Another possibility is that your dat is pixel registered and you asked to make a grid using grid registration. I would need the data to investigate it further (and time).

Hi, thanks for the quick response!
So using the same increment does sadly not change anything. Regarding the data, it simply [lon lat z-value] read from a csv file where the coordinates follow the era5 convention e.g [90.0,0.0,20.258586589748482] would be the first row. The data contains also coordinates lying on the oceans if this info helps.

I cannot see any other reason for those lines than that there is data in your csv file causing them. If I do this round trip, I see no spurious lines over the oceans.

G = gmtread("@earth_relief_01d");
G = grdlandmask(G, maskvalues=(NaN,1));
Dxyz = grd2xyz(G);
Grec = xyz2grd(Dxyz, inc=1, region=:global);
viz(Grec)

I’ve seen artefacts like this from time to time.

I don’t know why they happen. But someone once told me it could be a Ghostscript issue.

I thought on that too, which is due to the anti-aliasing filter in ghostscript. But those manifest as gray lines and are visible only over non-white areas. On the contrary, these ones are only visible on white areas and they color changes, which is clearly a signal that they are data-dependent. That is why I said that without the data there nothing more we can help with.