# Grd2cpt - CDF behaviour with -T option

**URL:** <https://forum.generic-mapping-tools.org/t/grd2cpt-cdf-behaviour-with-t-option/681>\
**Category:** Q&A\
**Created:** [July 17, 2020, 9:12pm UTC](https://forum.generic-mapping-tools.org/t/grd2cpt-cdf-behaviour-with-t-option/681 "2020-07-17T21:12:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JJJP](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@JJJP](https://forum.generic-mapping-tools.org/u/JJJP)\
**Post date:** [July 17, 2020, 9:12pm UTC](https://forum.generic-mapping-tools.org/t/grd2cpt-cdf-behaviour-with-t-option/681/1 "2020-07-17T21:12:05Z")

</div>

Hello,

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:

 ![THD](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/bf8d5775d0e437105256e6484eee8e5b91cc56e6.jpeg)

 ![Screenshot 2020-07-17 at 22.06.53](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/6f4688bf888dcdded8c1d2ca42928a6a57654500.png)

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

 ![THD](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/6919c3921f6842323f4e332d2754e60aaad8333d.jpeg)

 ![Screenshot 2020-07-17 at 22.09.35](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/045b514dda48dc6f9bdbdfd42d17a15730aaa6e7.png)

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [July 17, 2020, 9:36pm UTC](https://forum.generic-mapping-tools.org/t/grd2cpt-cdf-behaviour-with-t-option/681/2 "2020-07-17T21:36:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![JJJP](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@JJJP](https://forum.generic-mapping-tools.org/u/JJJP)\
**Post date:** [July 17, 2020, 9:56pm UTC](https://forum.generic-mapping-tools.org/t/grd2cpt-cdf-behaviour-with-t-option/681/3 "2020-07-17T21:56:29Z")

</div>

Hello,

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

> **[Dropbox - Error - Simplify your life](https://www.dropbox.com/s/6f7h39208kmmvy8/THD.grd?dl=0)**

grdinfo:

 ![Screenshot 2020-07-17 at 22.49.50](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/a0e9f5527ad604c8f91fab1cc785067a69a903fc.png)

Cheers, J

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [July 17, 2020, 10:51pm UTC](https://forum.generic-mapping-tools.org/t/grd2cpt-cdf-behaviour-with-t-option/681/4 "2020-07-17T22:51:38Z")

</div>

Thanks I can reproduce your cpt results.
