☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

LinearColorMapper for line glyph possible?

Community Support
nodefeet
nodefeet

I was wondering if it is possible to use a color mapper like LinearColorMapper for a line glyph?
It would be cool to interpolate the color of the line itself between the datapoints according to a given color mapper.

But this is currently not possible, right?

⌁   Link to post
Bryan
Bryan

This is not currently possible, and will never be possible. The Line Bokeh glyph maps to the underlying HTML canvas line primitive which can only draw a single color.[1] If you want multiple segments that are different colors, you should user multi_line.


  1. Besides that, there is an additional reason why it can’t work. The connected topology of a line is different from other glyphs. A column of N points only gets you N-1 line segments (between the points), as opposed to a scatter which gets you N scatter points. All the columns of a CDS must always be the same length (i.e. N in this case) which means there are too many colors, you would have to somehow colormap N-1 segments based on N values and that does not work out. ↩︎

⌁   Link to post

End of archived discussion · Replies are disabled