Grdimage/Grdcontour : hide zeros/hide lines and annotations


I try to plot sea-ice concentration over the arctic ocean and I encountered some difficulties.

First I tried to simply use grdimage, but I couldn’t make --COLOR_BACKGROUND nor --COLOR_NAN transparent for some reason.

Now I’m trying a workaround using grdcontour, but I can’t hide unexpected annotations.
I thought -An+i was supposed to get rid of the annotation ([n]) and the lines ([+i]) … but lines appear.
So I try -A0,+i, lines disappear, but annotations appear !

What am I missing ?

Here’s what I do (data attached) :


gmt begin arctic_map png

    gmt makecpt -Coslo -T1/108/3 -H -N > ice.cpt

    gmt grdcontour -Cice.cpt ${region} ${projection} -N -A0,+i -S10 --COLOR_NAN=red@100 --COLOR_BACKGROUND=red@100

gmt end show (313.3 KB)

Thanks !

I fixed the problem with an extra step : grdsample.

gmt grdsample -I30s -nl

Allows me to replace the zeros with NaNs ([+n0]).

Then I can use grdimage with -Q to ignore the NaNs.

gmt grdimage -Cice.cpt -Q 

(so no need for --COLOR_BACKGROUND which transparency isn’t working)