Now, for some reason, I want to add a colorbar to this figure (yes, the colorbar has nothing to do with the plot… yet).
I just want an independant colorbar, say on the right of the figure, showing some colormap, for example cmap=cgrad(:thermal), with values ranging between 0 and 1.
I found many issues related to the colorbar itself, but I could not understand how to create a custom colormap in Plots.jl. Any help appreciated !
If we’re adding how other plotting packages handle this, this is a good example how Makie does these things a bit differently and you add a colorbar explicitly instead of using a plotting command as a workaround:
using CairoMakie
f, ax, sc = lines(rand(10))
cb = Colorbar(f[1, 2], colormap = :turbo, colorrange = (0, 1))
f