# Psxy, fill option without covering the topography below

**URL:** <https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622>\
**Category:** Q&A\
**Created:** [January 20, 2023, 4:33pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622 "2023-01-20T16:33:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chiara](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@Chiara](https://forum.generic-mapping-tools.org/u/Chiara)\
**Post date:** [January 20, 2023, 4:33pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/1 "2023-01-20T16:33:18Z")

</div>

Hi everyone,

I am trying to make a plot using psxy but I am failing in my attempt to create a map.

I want to cover parts of the topography with some polygon shape. I want to show the area of the polygons but at the same time I would like to keep showing the toopgraphy below. So,let’s say that I just want to darken a tiny bit the polygons area compared the ouside areas.

The input file for my irregular shapes is an xy file. So far, I have been using gmt psxy with the -G option to fill the area inside the polygons but, obviously, the inside area completely cover the topography below.  
I made few attempts with trasparency or by using grdimage but nothing come out of it as I want some color

Do you have some suggestions?

I am using gmt 5.4.4.

Thanks for everyone who can provide some suggestions.

Chiara

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [January 20, 2023, 4:44pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/2 "2023-01-20T16:44:13Z")

</div>

I think e.g. `psxy -Gred@50` should work.  
First step though; upgrade your gmt. 5.4.4 is too old.

---

<div class="post-metadata">

**Author:** ![Chiara](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@Chiara](https://forum.generic-mapping-tools.org/u/Chiara)\
**Post date:** [January 20, 2023, 5:05pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/3 "2023-01-20T17:05:22Z")

</div>

Hi,  
Thanks for replaying.  
Unluckily, I already tried that but it not working. It hides the topography.

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [January 20, 2023, 5:14pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/4 "2023-01-20T17:14:14Z")

</div>

Please install latest version and see if that helps.

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [January 20, 2023, 9:22pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/5 "2023-01-20T21:22:39Z")

</div>

Transparency (`@50`) only works in PDF. Default output of GMT 5.4.4 is PostScript. If I remember correctly transparency is available in this ancient version, you just need to make sure to convert it from PostScript to PDF. Have a look at [`psconvert` in the GMT 5.4 docs](https://docs.generic-mapping-tools.org/5.4/psconvert.html).

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [January 20, 2023, 9:39pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/6 "2023-01-20T21:39:03Z")

</div>

I wasn’t precise on how transparency works in GMT 5.4 and `psconvert`. No need to make a PDF if you don’t need that output format:

> Note: If the PostScript file calls on any of the Adobe PDF transparency extensions _and_ PDF is not the selected output format, then the file will first be converted to a temporary PDF file (for the transparency to take effect) before converting the PDF to the desired output format.

_Source: [GMT 5.4 `psconvert` docs](https://docs.generic-mapping-tools.org/5.4/psconvert.html)_

So feed your PostScript output through `psconvert` and have it converted to another format and you should see your transparent polygon.

And please follow @Andreas advice and install the current version of GMT. A lot has been improved! There is help available on how to migrate your GMT 5 scripts to run under GMT 6. Check out “[Migrating from an Earlier Version](https://docs.generic-mapping-tools.org/dev/migrating.html)” in the documentation.

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [January 20, 2023, 10:27pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/7 "2023-01-20T22:27:49Z")

</div>

Thanks @KristofKoch for mentioning that. I forgot about the postscript-to-other-formats dance that was necessary back then.

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [January 20, 2023, 10:58pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/8 "2023-01-20T22:58:13Z")

</div>

@Andreas I agree it is not the most intuitive way. _Classic mode_ has quite a steep learning curve but gives you extremely fine grained control over your plot. Every time I have the chance to reuse “expensive” (read: CPU heavy) layers for multiple plots I resort to _classic mode_. Just save the layer somewhere separate and bake it in on the next run.

---

<div class="post-metadata">

**Author:** ![Chiara](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@Chiara](https://forum.generic-mapping-tools.org/u/Chiara)\
**Post date:** [January 23, 2023, 12:21pm UTC](https://forum.generic-mapping-tools.org/t/psxy-fill-option-without-covering-the-topography-below/3622/9 "2023-01-23T12:21:12Z")

</div>

Dear @Andreas and @KristofKoch,

thanks for both of you to provide suggestions.  
I followed them and now I can the map as I wanted.

Thanks again.  
Chiara
