# Custom colorbar pygmt

**URL:** <https://forum.generic-mapping-tools.org/t/custom-colorbar-pygmt/3425>\
**Category:** PyGMT Q&A\
**Created:** [November 9, 2022, 2:29pm UTC](https://forum.generic-mapping-tools.org/t/custom-colorbar-pygmt/3425 "2022-11-09T14:29:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtabbakhha](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mtabbakhha](https://forum.generic-mapping-tools.org/u/mtabbakhha)\
**Post date:** [November 9, 2022, 2:29pm UTC](https://forum.generic-mapping-tools.org/t/custom-colorbar-pygmt/3425/1 "2022-11-09T14:29:28Z")

</div>

Hi everyone,

I need to put a custom colorbar for my pygmt figure. the intervals are 0,0.5,1,2.5 and 3.5 with colors of green,yellow,orange and red. Is there anyway to do it in pygmt?

---

<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:** [November 9, 2022, 3:37pm UTC](https://forum.generic-mapping-tools.org/t/custom-colorbar-pygmt/3425/2 "2022-11-09T15:37:17Z")

</div>

Hey @mtabbakhha,

it is a bit difficult to help you out without any script. Maybe you can provide a small script or code example, that people understand in more detail what you want to accomplish 😉. You can format your script as code by placing three backticks (```) in the line before and after the block with the code:

````auto
```
# your script formated as code
```

````

Maybe this PyGMT gallery example serves as an orientation:  
[Color points by categories — PyGMT](https://www.pygmt.org/latest/gallery/symbols/points_categorical.html#sphx-glr-gallery-symbols-points-categorical-py)
