MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.39k stars 302 forks source link

Automatic extension of colorbar #1783

Closed natgeo-wong closed 2 years ago

natgeo-wong commented 2 years ago

Hi, as per advice a few days ago, I would like to open this issue for colorbar extensions to automatically extend the colormap for discrete colormaps.

Currently, the :auto: option for extending the colorbar results in the following:

Screen Shot 2022-03-21 at 5 13 02 pm

But I would like something like this instead: 01c-flsm_BRN

Where the colormap is automatically extended to fit.

briochemc commented 2 years ago

Just to be clear for the record here, the current issue is that in the discrete case, the :auto option uses the same color for the extension and for the last level inside the color range.

For instance, the issue in the 1st image above is that the color between +4 and +5 is the same as the color above +5.

Instead it would be better to stretch the colormap (by one or two entries, depending on whether one or both extensions are requested) and then ensure that the extensions are colored with the next/previous color, as in the second image.

jkrumbiegel commented 2 years ago

Should be fixed by https://github.com/JuliaPlots/Makie.jl/pull/2183

jkrumbiegel commented 2 years ago

An example from the docs

image