Axis color bar

How to show a color gradient bar along one of the axes:

I would suggest to use Plot.raster for this task. I’ve sent you a suggestion.

1 Like

Hi, thanks for the suggestion! Do you know a way of making the height of the raster independent from the scale on the Y axis?

I’ve added that in my suggestion, using a mini plot. It’s a lot of additional code though, I wonder if there is a simpler way.

Yes thanks, that works quite well. Took me a while to figure out the subplot thing. I’ve adapted the code a bit because in my use cases the colors where part of the source data set and are not easily calculated from any coordinate.

the discussion continues here Raster positioning · observablehq/plot · Discussion #2313 · GitHub