# "Dual" ticks on colourbar

**URL:** <https://discourse.julialang.org/t/dual-ticks-on-colourbar/136540>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [April 3, 2026, 10:42am UTC](https://discourse.julialang.org/t/dual-ticks-on-colourbar/136540 "2026-04-03T10:42:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dolefeast](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dolefeast/32/216068_2.png) [@dolefeast](https://discourse.julialang.org/u/dolefeast)\
**Post date:** [April 3, 2026, 10:42am UTC](https://discourse.julialang.org/t/dual-ticks-on-colourbar/136540/1 "2026-04-03T10:42:28Z")

</div>

I have two functions f, g with different ranges but same domain. I visualize function f through a heatmap and function g through a contour map. To be able to plot them together I have to rescale g as seen in the code below. This way they have the same range.

```julia-auto
using Plots

x = range(0, 10, 100)
y = range(0, 10, 100)

f = @. sin(x)' * sin(y)

g = (x, y) -> (x^2 - y ^2) * sin(x)*sin(y)

normalization = max(f...) / max(@. g(x', y)...)

desired_g_value = 1.

p = heatmap(x, y, f,
colorbar_title ="f")
contour!(p,
    x, 
    y, 
    (x ,y) -> normalization * g(x, y),
    levels=normalization*desired_g_value:normalization*desired_g_value,
    clim=(-1, 1), # range of f
    c=:black
)   

```

This yields the following plot:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/1/119014f9bc93c50914d5577fc3aec8ca5ce03d23.png)

I would like to have at the left of the colorbar the ticks for the function g (before rescaling). Is it possible? If so, how?
