How to change the Glyph rendered in the Legend?

Hello all, I am plotting a line chart with Bokeh, like the one below (color is grouped by year). However notice how the legend that is generated uses the same Glyph (a line) as the actual plot. I’m wondering if there is a way to change the glyph in the legend from a line to something else (in this case a circle), retaining the same line plot, color schemes, and interactivity. My instinct was to artificially construct a separate Glyph Renderer object and use that to construct a legend manually but that did not work.

Has anyone dealt with this before I did not find a solved solution to changing the actual glyph (rather than a property) on here, StackOverflow, or Github?

Hi, I’m dealing with a similar problem where my glyphs have a variable alpha and colours and I’m not happy with what is being picked for the legend (please see my question).

I had gone through that same Bokeh documentation before but as your question points out this seems like a feature that is still not functional to work (which is quite disappointing). I will keep this Topic open however hopefully in case there is development on the issue.

As is the case with many (most?) popular open source projects, there is more work than people to do it. Realistically, the only thing that will accelerate development (or drive specific priorities) is for more new contributors to decide to become involved.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.