How to change color of the land area?

Here are the instructions:
Examples:
* color=:red Single color
* color=200 Single gray
* color="#aabbcc" Single color
* color=“30/20/180” Single color
* color=“yellow,brown” Two colors
* color=(30,180) Two gray levels
* color=((30,20,180),) Single color
* color=((10,50,99),(20,60,90)) Two colors
* color=[0.118 0.078 0.706] Single color in [0 1]
* color=[10 50 99; 20 60 90] Two colors
* color=(:red,:green,:blue) Three colors

However, the only one that works are things like:
color=:geo

Why doesn’t the below works?
color="250/240/230"

Here is my code:
grdimage!(Land_clip, color=:geo, nan_alpha=true, shade=false,
xaxis=(annot=15, grid=30, FONT_ANNOT_PRIMARY=“12p,Helvetica,black”,),
yaxis=(annot=15, grid=15, FONT_ANNOT_PRIMARY=“12p,Helvetica,black”,),
par=(MAP_GRID_PEN_PRIMARY=“0.005p”,), coast=true);

Many thanks!

Well, if Land_clip is a grid you need to pass grdimage a colormap and not a single color no?

 C = makecpt(range=(0,10), color="yellow,brown")
Extract of a GMTcpt exposed as a GMTdataset for display. Colors converted to [0-255]
Model: rgb
Color depth: 24
1×9 GMTdataset{Float64, 2}
 Row │      r1       g1       b1       r2       g2       b2    alpha       z1       z2
     │ Float64  Float64  Float64  Float64  Float64  Float64  Float64  Float64  Float64
─────┼─────────────────────────────────────────────────────────────────────────────────
   1 │   255.0    255.0      0.0    165.0     42.0     42.0      0.0      0.0     10.0
imshow(C)

1 Like

Many thanks, Joaquim!

So I would need something like the below?

cpt0 = makecpt(color=“250/240/230”);

grdimage!(Land_clip, color=cpt0, nan_alpha=true, shade=false,
xaxis=(annot=15, grid=30, FONT_ANNOT_PRIMARY=“12p,Helvetica,black”,),
yaxis=(annot=15, grid=15, FONT_ANNOT_PRIMARY=“12p,Helvetica,black”,),
par=(MAP_GRID_PEN_PRIMARY=“0.005p”,), coast=true);

It does not work for me. Is range=(0,10), a mandatory argument? I just need the land color to be a uniform color. What is the range? elevation?

I think you’ll need at least two colors, even if they are repeated.

cpt0 = makecpt(color=“250/240/230,250/240/230”);

1 Like

Many thanks for the tip.

Unfortunately, my map is still not filled with any color. There is no error message as well.

Below is my updated code:

cpt0 = makecpt(color=“250/240/230,250/240/230”);
grdimage!(Land_clip, color=cpt0, nan_alpha=true, shade=false,
xaxis=(annot=15, grid=30, FONT_ANNOT_PRIMARY=“12p,Helvetica,black”,),
yaxis=(annot=15, grid=15, FONT_ANNOT_PRIMARY=“12p,Helvetica,black”,),
par=(MAP_GRID_PEN_PRIMARY=“0.005p”,), coast=true);

Yep, expected :slight_smile:
To create a cpt you need to use the range option with the zlimits of your grid. Or use grd2cpt. This surely will give you something

C = grd2cpt(Land_clip, color="250/240/230,250/240/230");
1 Like

Working now! Thank you so much, Joaquim.