The below code creates stacked Plotly sub plots with a shared x axis.
I would like to add a horizontal scrollbar at the bottom.
from plotly.subplots import make_subplots
import plotly.graph_objects as go
fig = make_subplots(rows=3, cols=1,
shared_xaxes=True,
vertical_spacing=0.02)
fig.add_trace(go.Scatter(x=[0, 1, 2, 3], y=[10, 11, 12, 13]),
row=3, col=1)
fig.add_trace(go.Scatter(x=[0, 1, 2, 3], y=[100, 110, 120, 130]),
row=2, col=1)
fig.add_trace(go.Scatter(x=[0, 1, 2, 3], y=[1000, 1100, 1200, 1300]),
row=1, col=1)
fig.update_layout(height=500,xaxis=dict(rangeslider=dict(visible=True), type="linear"))
fig.show()
Unfortunately it’s corrupting the first sub plot and overlaying the scrollbar over the middle plot.
How do I fix this?