How to Create a Log-scale Colorbar with Evenly Spaced Ticks at Powers of 2 in GMT/PyGMT?

Hi everyone,

I’m trying to create a linear colorbar in GMT or PyGMT with tick marks at powers of 2 (e.g., 0, 2, 4, 8, 16, 32, 64, 128). I’d like the tick marks to appear evenly spaced along the colorbar, even though the values correspond to a powers-of-2 progression. Additionally, I need the colors to transition linearly (see the attached figure for reference).

Does anyone know how to achieve this? I’d appreciate any suggestions or examples. Thank you!

The solution would be to create a linear colorbar and add custom annotations and tick marks to it (if I understood your query correctly).

1 Like

Isn’t it possible to create a discrete colormap from an array?
Like associating bins to color-range ?