# Colorbar with -Q option

**URL:** <https://forum.generic-mapping-tools.org/t/colorbar-with-q-option/1469>\
**Category:** Q&A\
**Created:** [March 18, 2021, 5:05am UTC](https://forum.generic-mapping-tools.org/t/colorbar-with-q-option/1469 "2021-03-18T05:05:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [March 18, 2021, 5:05am UTC](https://forum.generic-mapping-tools.org/t/colorbar-with-q-option/1469/1 "2021-03-18T05:05:21Z")

</div>

Hi there,

I made a CPT using the log10 “3 increment” options :

```auto
makecpt -T1/100/3+l

```

Now I want a colorbar with that discrete palette, but it seems I can’t have it automatically generated.  
The only thing I’ve found so far is this trick :

1. use `colorbar -Q` without -B option to read .CPT directly
2. use `colorbar -Bx+l -By+l` to add the labels

(1) give the proper ticks, (2) the decoration … but none of them have color inside …

Am I missing something ?

```auto
gmt makecpt -Coslo -T1/100/3+l -A95 -H > cold.cpt
gmt colorbar -Ccold.cpt -DJCB+ef+w10c/0.3c+h -Bx+llegend -By+lunits
gmt colorbar -Ccold.cpt -DJCB+ef+w10c/0.3c+h -Q -Np

```

---

<div class="post-metadata">

**Author:** ![hzfmer](https://avatars.discourse-cdn.com/v4/letter/h/4bbf92/32.png) [@hzfmer](https://forum.generic-mapping-tools.org/u/hzfmer)\
**Post date:** [March 18, 2021, 5:53am UTC](https://forum.generic-mapping-tools.org/t/colorbar-with-q-option/1469/2 "2021-03-18T05:53:05Z")

</div>

> [@PlanetGus](#):
>
> ```auto
> gmt makecpt -Coslo -T1/100/3+l -A95 -H > cold.cpt
> gmt colorbar -Ccold.cpt -DJCB+ef+w10c/0.3c+h -Bx+llegend -By+lunits
> gmt colorbar -Ccold.cpt -DJCB+ef+w10c/0.3c+h -Q -Np
> 
> ```

When you say “no color”, I guess it’s because you set a too high transparency value (-A95)? At least “-A5” will render the color for me.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [March 18, 2021, 6:14am UTC](https://forum.generic-mapping-tools.org/t/colorbar-with-q-option/1469/3 "2021-03-18T06:14:41Z")

</div>

Correct !  
(for some reason the transparency is not applied on my plot so I didn’t think about it).

Thanks, I’ll try to fix the problem I’ve left with the extra ticks
