Custom Colorbar in Pygmt

Hi everyone,
I have been struggling with creating customized color bars in PyGMT. For example, I am able to create the following type of sequential colorbar.


However, I am not able to create the following discrete colorbars.

The main problem that I am facing is that with the pygmt.makecpt () command (pygmt.makecpt — PyGMT). There are a number of arguments can be passed, but many of these arguments are not clearly stated and provided with examples in the documentation. For example, I don’t understand what the meaning of the color_model argument is. I believe if these arguments are properly documented, then many of the users can be beneficial.
I would really appreciate if someone could help me to resolve this issue.

If you check the PyGMT man page for the makecpt wrapper you’ll see
which tells us that color_model is an alias to the plain GMT -F option.
Porting the entire GMT docs to wrappers is a huge task. We count on the good will of users to read also the plain GMT docs.

Hi @Joaquim, Thank you very much for replying me back.
I apologize that I don’t use GMT, rather I have used PyGMT. I don’t figure out these aliases provided by the developers. If you could provide a good example of how to make a custom CPT that would be greatly helpful.


This example shows how to create a categorical colorbars