Grd2cpt - CDF behaviour with -T option


I’m trying to create an evenly distributed continuous colour palette for a grid where a large proportion of the grid’s values cover a only small range of the total values. A simplified version might look something like:

1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 9 1 1
1 1 1 1 1 1

I think GMT’s cumulative distribution function should spread the colour palette to plot an even distribution of colour across the map area, which it seems to do pretty well when I set the -T option to select 6 (or less) levels from the CDF. However, if I ask it to select 7 levels (or more), the produced map then appears heavily colour skewed. Hopefully images visible below.

If anyone has any insight into this behaviour and how to ensure an even distribution of colour on the map that would be fab.

Thanks, J

gmt grd2cpt THD.grd -T6 -Z -Chaxby -V > col1.cpt results in:

gmt grd2cpt THD.grd -T7 -Z -Chaxby -V > col1.cpt results in:

Well, certainly looks a bit odd that the -T7 shoves most into the first blue band. I take it your grid goes from 4.6e-8 to 0.0035841… then? I cannot reproduce this problem without an example - might you be willing to post your grid?


Thanks for your help! Sure thing, hopefully you can access the grid here:


Cheers, J

Thanks I can reproduce your cpt results.