✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Stacking candlestick plot - How to disable range selector

Hi everyone,

Just picked up python and plotly recently. I am trying stack multiple candlestick chart using plotly and disable the rangeselector that is generated automatically. However, seems like when its stacked, when I used update(layout_xaxis_rangeslider_visible=False), only one of the figure’s rangeselector was made invisible? Is there a way for me to make both range selector not visible. Code below, any help is much appreciated!

import plotly.graph_objects as go
import pandas as pd
from datetime import datetime

df = pd.read_csv(‘https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv’)

fig2 = make_subplots(rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.01)

fig2.add_trace(go.Candlestick(x=df[‘Date’],
open=df[‘AAPL.Open’],
high=df[‘AAPL.High’],
low=df[‘AAPL.Low’],
close=df[‘AAPL.Close’]),row=1,col=1
)

fig2.add_trace(go.Candlestick(x=df[‘Date’],
open=df[‘AAPL.Open’],
high=df[‘AAPL.High’],
low=df[‘AAPL.Low’],
close=df[‘AAPL.Close’]),row=2,col=1
)

fig2.update(layout_xaxis_rangeslider_visible=False)
fig2.show()