Custom color palette (including associated value range)

sylvaticus
Fri, 29 Aug 2025 19:38:09 +0000
Visualization

I am looking to how create a custom “legend” for my plots where I associate given colours to custom ranges, for example:

0:0.5    => darkdarkred
0.0:0.75 => darkred
0.75:1   => red
1:1.25   => green
1.25:1.5 => darkgreen
1:5:2    => darkdarkgreen

I need it co compare different plots where I want the association value => colour to remain stable, like here (obtained with plot(myraster, c = palette([:red, :green], 5)) ) :

4 posts - 4 participants