Cannot cancel the display of grid lines when using transparent color

When I use transparent colors, the grid lines are still faintly visible on the map, even with g0 parameter. I don’t know if this is a bug, or if it’s just a problem with my settings?

Here is the code and plot.

gmt begin grids_bug png
# transparent
gmt coast -JW15c -Rg -Gblack@50 -Cblue@90 -Sskyblue@50 -Bxya20f0g0  -A4000  -W0.25p,black
# no transparent
#gmt coast -JW15c -Rg -Gblack -Cblue -Sskyblue -Bxya20f0g0  -A4000  -W0.25p,black
gmt end

Mm I think it is a bug.

No bug. See https://docs.generic-mapping-tools.org/dev/cookbook/include-figures.html?highlight=aliasing#using-psconvert
Try a different dpi.

Thanks for your answer. I changed the dpi to 3000, although there has been some improvement, the gridlines on land still exist. Could you help me make a demo? I just want to achieve the same effect when not using transparent colors.

The output figure size exceeded the upload limit, so it failed to upload.
My new code,

 gmt begin "grids_bug" png A,E3000 -C
 # transparent
 gmt coast -JW15c -Rg -Gblack@50 -Cblue@90 -Sskyblue@50 -Bxya20f0g0  -A4000  -W0.25p,black
 # no transparent
 #gmt coast -JW15c -Rg -Gblack -Cblue -Sskyblue -Bxya20f0g0  -A4000  -W0.25p,black
 gmt end

It turns out that those lines, which do not depend on the transparency, are in fact caused by fact that the borders between the individual patches that make up the image do not coincide exactly and sometimes we can see the background whilst in others they slightly overlap. We can see that with the PDF version which allows a very high zoom level. Now, it’s also strange that the visibility this effect seems to be very dependent on the choose colors. For example, the example 1 in the gallery also have a tinny bit it but it’s very difficult to spot.

1 Like

I agree there is an issue here. This plot skips all lakes and only shows the filled 10x10 degree blocks used by the low-resolution coastline:

gmt coast -JW15c -R70/110/30/60 -Gblack -B -A40000 -Dl -pdf map

You can see the polygon boundaries are not exact. Why is not clear since they all get their coordinates from the same function gmt_graticule_path. So I think the path from, say (80,40) to (80,50) are exactly the same in the two neighboring blocks. However, we also have some PostScript coordinate simplifications going on and I suspect this is where there may be some tiny differences. I will make an issue and explore this. Perhaps we will need to turn off that effect for coast.

2 Likes