# How to adjust min/max values of built in CPT ? (python)

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-adjust-min-max-values-of-built-in-cpt-python/1587>\
**Category:** PyGMT Q&A\
**Created:** [April 19, 2021, 9:16am UTC](https://forum.generic-mapping-tools.org/t/how-to-adjust-min-max-values-of-built-in-cpt-python/1587 "2021-04-19T09:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljeonjko](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@ljeonjko](https://forum.generic-mapping-tools.org/u/ljeonjko)\
**Post date:** [April 19, 2021, 9:16am UTC](https://forum.generic-mapping-tools.org/t/how-to-adjust-min-max-values-of-built-in-cpt-python/1587/1 "2021-04-19T09:16:35Z")

</div>

Hello!

I have a set of values ranging from 0.6 to 0.9 I wish to plot. Say I’m using the “jet” CPT. If i plot normally, the graph colour ranges from yellow to red, as shown in the image.

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/e/e8290fbc7b1cb1a994d11563a2f5baea4fe85862.png)

Is there a way to make 0.6 the starting value, so that the yellow points are blue, while keeping the red points still red? Guess what I’m asking is whether it’s possible to “compress” the built-in CPT values, or do I have to make a custom CPT?

Much obliged 🙂

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [April 19, 2021, 12:57pm UTC](https://forum.generic-mapping-tools.org/t/how-to-adjust-min-max-values-of-built-in-cpt-python/1587/2 "2021-04-19T12:57:32Z")

</div>

Hi @ljeonjko,

not a PyGMT user but you might want to look into [`makecpt`](https://docs.generic-mapping-tools.org/latest/makecpt.html):

```
gmt makecpt -Cjet your_data_file > your_shiny_new_CPT.cpt

```

I’m sure you can adapt this to work in PyGMT.

All the best!

---

<div class="post-metadata">

**Author:** ![ljeonjko](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@ljeonjko](https://forum.generic-mapping-tools.org/u/ljeonjko)\
**Post date:** [April 19, 2021, 4:21pm UTC](https://forum.generic-mapping-tools.org/t/how-to-adjust-min-max-values-of-built-in-cpt-python/1587/3 "2021-04-19T16:21:28Z")

</div>

Thanks for the tip! I did it like this:

```
  pygmt.makecpt(cmap="jet", series=[0.6, 0.9, 0.01])

```

Put it before you plot anything, and make sure to use `cmap = True` wherever `cmap` occurs during plotting.

Thank you once again! 🙂
