# Remove colorbar ticks and labels

**URL:** <https://forum.generic-mapping-tools.org/t/remove-colorbar-ticks-and-labels/1811>\
**Category:** PyGMT Q&A\
**Created:** [June 20, 2021, 2:53pm UTC](https://forum.generic-mapping-tools.org/t/remove-colorbar-ticks-and-labels/1811 "2021-06-20T14:53:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheGermanSquirrel](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@TheGermanSquirrel](https://forum.generic-mapping-tools.org/u/TheGermanSquirrel)\
**Post date:** [June 20, 2021, 2:53pm UTC](https://forum.generic-mapping-tools.org/t/remove-colorbar-ticks-and-labels/1811/1 "2021-06-20T14:53:00Z")

</div>

Hi,

I would like to remove colorbar labels and ticks.

```
def plot_something(fig, panel):

     region = [131.29, 150.89, 34.02, 50.77]
    
    with fig.set_panel(panel=panel):    
        
        fig.basemap(region=region, projection="M?", panel=panel)
        fig.coast(land="grey", projection="M?", region=region, panel=panel, water="white")
       
    return fig

with fig.subplot(
    nrows=1,
    ncols=2,
    figsize=("15c", "6c"),
    frame=["af", "WSne"],
):
    
    plot_something(fig, panel=[0])
    plot_something(fig, panel=[1])   

fig.colorbar(cmap="polar", frame=["af", "y+lX", "wesn"], position="JBC+w6c/0.5c") 

fig.show()

```

 ![japan_subplot](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/4/4758a3fd8f9376636e8ea52de88b7f69a2007e6e.png)

How can I remove all ticks from the colorbar? I removed the colorbar range labels using “wesn” in `fig.colorbar()` but that doesn’t seem like the proper way to do it.

Note that the polar colormap is not showing any data here, this was just for MWE purposes.

Any help would be much appreciated!

---

<div class="post-metadata">

**Author:** ![maxrjones](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/maxrjones/32/2698_2.png) [@maxrjones](https://forum.generic-mapping-tools.org/u/maxrjones)\
**Post date:** [June 20, 2021, 4:31pm UTC](https://forum.generic-mapping-tools.org/t/remove-colorbar-ticks-and-labels/1811/2 "2021-06-20T16:31:55Z")

</div>

For `frame`, adding `a` in the argument adds major ticks and annotations and adding `f` adds minor ticks. So if you were to not want any annotations or ticks, you would just leave those options out of your argument to the `frame` parameter:

`fig.colorbar(cmap="polar", frame=["y+lX"], position="JBC+w6c/0.5c") `

If you were to want annotations but not ticks, you could set the tick length to 0:

```auto
with pygmt.config(MAP_TICK_LENGTH=0):
    fig.colorbar(cmap="polar", frame=["a","y+lX"], position="JBC+w6c/0.5c") 

```

---

<div class="post-metadata">

**Author:** ![TheGermanSquirrel](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@TheGermanSquirrel](https://forum.generic-mapping-tools.org/u/TheGermanSquirrel)\
**Post date:** [June 20, 2021, 5:34pm UTC](https://forum.generic-mapping-tools.org/t/remove-colorbar-ticks-and-labels/1811/3 "2021-06-20T17:34:03Z")

</div>

Thank you so much!
