Curious learner
Curious learner

Reputation: 43

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)

Upvotes: 4

Views: 3703

Answers (1)

jayveesea
jayveesea

Reputation: 3219

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.

Upvotes: 6

Related Questions