Launching a plot with some series hidden and some not (but all available in the legend)

Iโ€™ve seen some pre-express examples of programatically launching a chart such that some series are hidden when it is initialy shown (and are available for toggle in the legend or via buttons thereafter), at plot - Plotly with python - line chart deselect all - Stack Overflow.

I wonder if we can accomplish the same using plotly express, e.g. for a plot created like:

plot = px.line(pd.DataFrame(series, columns=series_names)

Thatโ€™s because I launch many plots where it makes sense to just show the first n series of the matrix by default, and make the other ones selectable on the legend. (or show some other subsets of the series included in the dataframe as the opening state when the plots launch).

Can that be accomplished using plotly express? or does it require unwinding my code to use the pre-express more tedious api?

I did try the AI box on the documentation website before asking :slight_smile:

Hi @matan3, this should help you:

1 Like

Oh, how elegant!