Multiple dropdowns and subplots

Hello

I have some precipitation + groundwater depth data that I plotted into a figure as subplots (precipitation as a bar on top and groundwater as lineplot at bottom). Each data type has multiple timeseries from different sites, and I want to be able to choose between the different combinations of sites and look at their corresponding graph.

Is this (or a close enough alternative) somehow possible? Iโ€™ve been playing with the button visibility argument but I donโ€™t think Iโ€™ll be able to do what I want using that option because this is statically setting the visibility of the traces.

Thanks in advance!

@arac_codespace
Welcome to Plotly forum! This notebook may suggest how to define your fig.layout.updatemenus and its buttons: https://chartstudio.plotly.com/~empet/15699

In your case after fig=make_subplots () definition,
the fig.data[k], k=0,1, โ€ฆn, is the (k+1)th
trace added to fig, via fig.add_trace.

1 Like