Grdimage/Grdcontour : hide zeros/hide lines and annotations

Hi,

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) :

region="-R0/360/65/90"
projection="-Js0/90/77/1:75000000"

gmt begin arctic_map png

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

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

gmt end show

data_bis.nc.zip (313.3 KB)

Thanks !

I fixed the problem with an extra step : grdsample.

gmt grdsample data_bis.nc+n0 -I30s -nl -Gdata_ter.nc

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

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

gmt grdimage  data_ter.nc -Cice.cpt -Q 

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