# In Plots.jl \`heatmap\`s, how do I set the colorbar ticks?

**URL:** <https://discourse.julialang.org/t/in-plots-jl-heatmap-s-how-do-i-set-the-colorbar-ticks/132894>\
**Category:** Visualization\
**Created:** [October 5, 2025, 6:24pm UTC](https://discourse.julialang.org/t/in-plots-jl-heatmap-s-how-do-i-set-the-colorbar-ticks/132894 "2025-10-05T18:24:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [October 5, 2025, 6:24pm UTC](https://discourse.julialang.org/t/in-plots-jl-heatmap-s-how-do-i-set-the-colorbar-ticks/132894/1 "2025-10-05T18:24:03Z")

</div>

if I create a heatmap:

```julia
using Plots
heatmap(rand(5,5); clim = (0.0, 1.0))

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/f/bf3031b26ce385cb02e7f8f6046d30d94cf3a235.png)

How do I set the ticks on the colorbar? I.e. if I would have wanted it to be `[0.0, 0.25, 0.5, 0.75, 1.0]`?

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 5, 2025, 6:59pm UTC](https://discourse.julialang.org/t/in-plots-jl-heatmap-s-how-do-i-set-the-colorbar-ticks/132894/2 "2025-10-05T18:59:23Z")

</div>

Check the keyword `colorbar_ticks` and the [Supported Attributes · Plots](https://docs.juliaplots.org/dev/generated/supported/).  
This is only supported by the pyplot() backend.

However, with any other backend, it is easy to create your own color bar and decorations by treating it as a heatmap in a neighboring subplot.  
Check out [this post](https://discourse.julialang.org/t/setting-the-foreground-color-of-colorbar-tick-marks/122911/4).

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [October 6, 2025, 7:48am UTC](https://discourse.julialang.org/t/in-plots-jl-heatmap-s-how-do-i-set-the-colorbar-ticks/132894/3 "2025-10-06T07:48:48Z")

</div>

Thanks 🙂
