So the docs pretty much make it look like displaying multiple legends for different items of the same trace
(plotly.graph_objs.Scatter
) isn't something that Plotly
supports by default. You should rather keep adding new traces to Figure and each of these traces contains its own legend.
However, this seems cumbersome for my specific case. What I have is a graph in Plotly Dash
where the user can search for different nodes & paths and so I am defining different colors according to the search and all of this within a single trace (by making use of colorscale & color from Scatter).
When a user searches for different nodes in the graph I am coloring them uniquely. I'd like to specifically show a legend for each of the different colors which highlight these nodes.
Is it possible to do this in a single trace?
Currently this is not possible. There is no such example in the docs though there is an issue on this topic since a couple of years now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With