3 ms·
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 lo
by MisterBiggs 6y ago
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.
- sterlinm 6y agoAltair does have interactive legends actually. But dash is great for more complicated interactions and layouts. Panel, streamlit, and voila are also all potentially useful. https://altair-viz.github.io/gallery/interactive_legend.html https://altair-viz.github.io/gallery/interactive_legend.html https://altair-viz.github.io/user_guide/interactions.html#selection-targets-fields-and-encodings https://altair-viz.github.io/user_guide/interactions.html#se...
- MisterBiggs 6y agoI stand corrected, I may have to revisit Altair. 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.
- cycomanic 6y agoWhile I agree with you that matplotlib should be replaced , I see a problem in that almost all these new plotting libraries are focused on plotting statistical type data. While this is obviously a big thing at the moment, more traditional type graphs are often not well catered for by these libraries. For example I work in signal processing and would like good looking line and 3d graphs with easy layout of multiple plots... Matplotlib despite its shortcomings is still the best tool for this.
- prepend 6y agoI think they added this in v4 within the last year. Altair is developing really quickly, and I like that. JVP has been really responsive and it’s amazing how quickly the project is adding features.