I've seen this done by making a fake legend out of a bar chart. As far as I know, there's no way to make an interactive legend in Altair.
Personally I would look into plotly / dash for something with interactivity.
Personally I would look into plotly / dash for something with interactivity.
https://altair-viz.github.io/gallery/interactive_legend.html
https://altair-viz.github.io/user_guide/interactions.html#se...
Some of those other options look pretty compelling too I think it's definitely time for something to replace Matplotlib as the go-to for python plotting.