# How to add the colorpalette

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-add-the-colorpalette/3718>\
**Category:** PyGMT Q&A\
**Created:** [February 28, 2023, 2:57pm UTC](https://forum.generic-mapping-tools.org/t/how-to-add-the-colorpalette/3718 "2023-02-28T14:57:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![prince-Ha](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/prince-ha/32/2754_2.png) [@prince-Ha](https://forum.generic-mapping-tools.org/u/prince-Ha)\
**Post date:** [February 28, 2023, 2:57pm UTC](https://forum.generic-mapping-tools.org/t/how-to-add-the-colorpalette/3718/1 "2023-02-28T14:57:39Z")

</div>

[http://soliton.vm.bytemark.co.uk/pub/cpt-city/views/totp-cpt.htm](http://soliton.vm.bytemark.co.uk/pub/cpt-city/views/totp-cpt.html)

How do I use the color palette I downloaded here on pygmt?

Thank you.

---

<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:** [February 28, 2023, 3:02pm UTC](https://forum.generic-mapping-tools.org/t/how-to-add-the-colorpalette/3718/2 "2023-02-28T15:02:46Z")

</div>

I’m not familiar with pyGMT but have you tried [the docs](https://www.pygmt.org/latest/api/generated/pygmt.makecpt.html)?

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [March 1, 2023, 9:51am UTC](https://forum.generic-mapping-tools.org/t/how-to-add-the-colorpalette/3718/3 "2023-03-01T09:51:20Z")

</div>

Hello @prince-Ha,  
As mentioned by @KristofKoch you can use a colorpalette downloaded from cpt-city (you need the `.cpt` format) via `pygmt.makecpt`, similarly as the GMT build-in colormaps. Please place the downloaded cpt file in your working dictionary or pass the whole path along with the file name to the `cmap` parameter. For further adjustments to make the final colormap meet your personal needs, you may want to have a look at the documentation at [https://www.pygmt.org/latest/api/generated/pygmt.makecpt.html](https://www.pygmt.org/latest/api/generated/pygmt.makecpt.html).

_General code example_:

```python
import pygmt

pygmt.makecpt(
    # replace the argument by the file name of your colorpalette file name
    cmap="my_downloaded_colormap.cpt",  
)

```

---

<div class="post-metadata">

**Author:** ![prince-Ha](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/prince-ha/32/2754_2.png) [@prince-Ha](https://forum.generic-mapping-tools.org/u/prince-Ha)\
**Post date:** [March 1, 2023, 10:21am UTC](https://forum.generic-mapping-tools.org/t/how-to-add-the-colorpalette/3718/4 "2023-03-01T10:21:20Z")

</div>

I solved the problem using below method

thank you : )

- download and make a colorpalette

- load the palette in cmap

- example code :

> import pygmt  
> fig = pygmt.Figure()  
> pygmt.makecpt(cmap=“temperature.cpt+h”, series=[x.values.min(), x.values.max()])
