Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python plotly | disable ALL rangesliders in a figure that has subplots

Using plotly(dash) I add multiple subplots to a figure using figure.add_candlestick(**args)

After the loop is done I disable the xaxis_rangeslider_visible but I still have a rangeslider at the bottom of the second/last chart. Does anyone know how to hide ALL rangeslider in a figure with multiple plots?

PositionFig = PositionFig.update_layout(xaxis_rangeslider_visible=False,
                          title_text="Position Charts",
                          height=1000)
like image 911
Curious learner Avatar asked Oct 29 '25 08:10

Curious learner


1 Answers

UPDATE: you can avoid the loop with fig.update_xaxes(rangeslider_visible=False) or in your case:

PositionFig.update_xaxes(rangeslider_visible=False)

Or you can loop back through and set it off for each axis:

for i in range(number_of_subplots,0,-1): # starting with the last and stopping at 0
    PositionFig.update_xaxes(row=i, col=1, rangeslider_visible=False)

where number_of_subplots is how many subplots you have, and assuming that they are in a single column.

like image 56
jayveesea Avatar answered Oct 31 '25 02:10

jayveesea



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!