# Cannot cancel the display of grid lines when using transparent color

**URL:** <https://forum.generic-mapping-tools.org/t/cannot-cancel-the-display-of-grid-lines-when-using-transparent-color/2475>\
**Category:** Q&A\
**Tags:** gmt\
**Created:** [December 30, 2021, 8:44am UTC](https://forum.generic-mapping-tools.org/t/cannot-cancel-the-display-of-grid-lines-when-using-transparent-color/2475 "2021-12-30T08:44:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![leeyupeng](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/leeyupeng/32/1827_2.png) [@leeyupeng](https://forum.generic-mapping-tools.org/u/leeyupeng)\
**Post date:** [December 30, 2021, 8:44am UTC](https://forum.generic-mapping-tools.org/t/cannot-cancel-the-display-of-grid-lines-when-using-transparent-color/2475/1 "2021-12-30T08:44:08Z")

</div>

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.

```bash
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

```

 ![grids_bug](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/b/b3718bc4328b979bd01f8960c47fd99d9c1ce93b.png)

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [December 30, 2021, 6:37pm UTC](https://forum.generic-mapping-tools.org/t/cannot-cancel-the-display-of-grid-lines-when-using-transparent-color/2475/2 "2021-12-30T18:37:40Z")

</div>

Mm I think it is a bug.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [December 30, 2021, 7:38pm UTC](https://forum.generic-mapping-tools.org/t/cannot-cancel-the-display-of-grid-lines-when-using-transparent-color/2475/3 "2021-12-30T19:38:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![leeyupeng](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/leeyupeng/32/1827_2.png) [@leeyupeng](https://forum.generic-mapping-tools.org/u/leeyupeng)\
**Post date:** [December 31, 2021, 2:41am UTC](https://forum.generic-mapping-tools.org/t/cannot-cancel-the-display-of-grid-lines-when-using-transparent-color/2475/4 "2021-12-31T02:41:10Z")

</div>

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,

```bash
 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

```

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [December 31, 2021, 12:45pm UTC](https://forum.generic-mapping-tools.org/t/cannot-cancel-the-display-of-grid-lines-when-using-transparent-color/2475/5 "2021-12-31T12:45:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [December 31, 2021, 6:54pm UTC](https://forum.generic-mapping-tools.org/t/cannot-cancel-the-display-of-grid-lines-when-using-transparent-color/2475/6 "2021-12-31T18:54:05Z")

</div>

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**.
