GenericMappingTools / gmt

The Generic Mapping Tools
https://www.generic-mapping-tools.org
Other
853 stars 357 forks source link

Bug with makecpt -C and --COLOR_BACKGROUND #5756

Closed Esteban82 closed 3 years ago

Esteban82 commented 3 years ago

When I rum makecpt with -C, I can't set the bakground color.

gmt makecpt -T0/3/1 --COLOR_BACKGROUND=red

0   70/134/250.5    1   70/134/250.5    L   
1   162.5/252.5/60.5    2   162.5/252.5/60.5    L   
2   228.5/70/10.5   3   228.5/70/10.5   B   
B   red     # Background change to red
F   white
N   128

gmt makecpt -T0/3/1 --COLOR_BACKGROUND=red -Cgeo

0   199.88/148.05/68.452    1   199.88/148.05/68.452    L   
1   106.82/90.227/81.591    2   106.82/90.227/81.591    L   
2   255/254/253 3   255/254/253 B   
B   black  # Background still black
F   white
N   gray
Esteban82 commented 3 years ago

The same applies to grd2cpt

 gmt grd2cpt @earth_relief_01d -T0/3/1 --COLOR_BACKGROUND=red -Cgeo
-8182   30.8/48/84.8    0       30.8/48/84.8    L
0       68.2/140.6/200.8        1       68.2/140.6/200.8        L
1       0/97/71 2       0/97/71 L
2       102.36/63.945/44.618    3       102.36/63.945/44.618    L
3       245.33/244.33/243.33    5651.5  245.33/244.33/243.33    B
B       black
F       white
N       gray
PaulWessel commented 3 years ago

Seems the default (turbo.cp) has no BNF settings while geo does. So internally, the red is used to updated the internal variable, but then it is overridden when geo is red. I think the intention is that the system COLOR_* are used when the CPT has no settings, but here they do. Perhaps this may require an option of modifier to work as you intend.

Esteban82 commented 3 years ago

In my case I make an animation like 03 but only painting the above part.

I try using this command for the CPT but I get black for background color.

gmt makecpt -Cdem4 -T0/700 -H > a.cpt

In order to get cpt that I want, I had to manually modified the cpt. How should I do that?

PaulWessel commented 3 years ago

Looking at this again. Try -M, I think that is what you want, no?

Esteban82 commented 3 years ago

Thanks. It worked. Sorry for the false bug.

PaulWessel commented 3 years ago

No worries. I had forgotten about -M.