I am trying to fill my polygons like this person tried: Fill color in polygons using attribute variable in GMT (Generic Mapping Tool) with some hints here: https://gmt.soest.hawaii.edu/boards/1/topics/7553 They suggest to:

Try what the man page for psxy -W says: +c Controls how pens and fills are affected if a CPT is specified via -C: Append l to let pen colors follow the CPT setting. Append f to let fill/font colors follow the CPT setting.

I tried but I get the error:

psxy: Pen name c not recognized!

when I try the solution suggested.

Code drawing the borders of the geologic layers with the palette colors:

gmt psxy "$repo/geology.gmt" $reg $proj -aZ=Code -C$colornames
-Zzval  -O -K

Code supposed to fill in those layers with the palette colors, but which gives an error:

gmt psxy "$repo/geology.gmt" $reg $proj  -W+c -aZ=Code -C$colornames -Zzval  -O -K

What do I do wrong?


In the end, it seems I forgot to close the polygons, thus they couldn't be filled!! This worked:

gmt psxy "$repo/geology.gmt" $reg $proj -L -aZ=Code -C$colornames -Zzval -O -K

-W alone uses the default pen but when you want to add modifiers (+c) here, I believe that you have to state also a pen. Try -W1p+c

  • I tried but it didn't work. I got the same message. I had to add -L. – Argent Jun 13 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.