Psxy, fill option without covering the topography below

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.


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

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

Please install latest version and see if that helps.

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.

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

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” in the documentation.

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

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

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.