How to add the colorpalette

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

Thank you.

1 Like

I’m not familiar with pyGMT but have you tried the docs?

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

General code example:

import pygmt

    # replace the argument by the file name of your colorpalette file name

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()])