# Transparent Contor Color

**URL:** <https://forum.generic-mapping-tools.org/t/transparent-contor-color/5716>\
**Category:** Q&A\
**Created:** [February 1, 2025, 2:55am UTC](https://forum.generic-mapping-tools.org/t/transparent-contor-color/5716 "2025-02-01T02:55:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kozan88](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kozan88/32/4707_2.png) [@kozan88](https://forum.generic-mapping-tools.org/u/kozan88)\
**Post date:** [February 1, 2025, 2:55am UTC](https://forum.generic-mapping-tools.org/t/transparent-contor-color/5716/1 "2025-02-01T02:55:25Z")

</div>

Hello,  
I am working on a base map with contours, and I want to color the contours as a transparent. I have a cpt file for that.  
Here’s the map before trying to color it:

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/2/2688b52f1dd7493a44e15f70ac353fc1f1f28434.jpeg)  
I used the command: `gmt grdimage contour.grd $REG $PROJ -Ccolors.cpt -t80 -O -K >> gmt.ps`  
I am trying to color only the range between 300 and 5000 for the map. However, after using the above command, the result is this:  
 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/9/91d03414dfa8ad8449b2100e5f6a9cc37ba8b5ed.png)  
Any thoughts? I want the color to be transparent and the black places to show the base map not black.

Thank you

---

<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:** [February 1, 2025, 5:28pm UTC](https://forum.generic-mapping-tools.org/t/transparent-contor-color/5716/2 "2025-02-01T17:28:24Z")

</div>

I would say that it’s due to the background color in the CPT but without a reproducible (small) example you probably won’t get much more help.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [February 3, 2025, 8:08am UTC](https://forum.generic-mapping-tools.org/t/transparent-contor-color/5716/3 "2025-02-03T08:08:16Z")

</div>

What Joaquim said, an small code excerpt is easier…

Though, you have options. Have you tried the `-L` flag in grdcontour ?

---

<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:** [February 3, 2025, 1:50pm UTC](https://forum.generic-mapping-tools.org/t/transparent-contor-color/5716/4 "2025-02-03T13:50:48Z")

</div>

I think that ex16 can help you ([(16) Gridding of data, continued — GMT 6.6.0 documentation](https://docs.generic-mapping-tools.org/dev/gallery/ex16.html))

Check at the cpt here: [gmtserver-admin/cache/ex\_16.cpt at master · GenericMappingTools/gmtserver-admin · GitHub](https://github.com/GenericMappingTools/gmtserver-admin/blob/master/cache/ex_16.cpt)
