Hi everyone,
I am trying to place a trend plot with a rangeslider as a subplot in a figure with other plots.
However I am having serious problems with the slider overlapping the other subplots.
I am using plotly for Python.
Here is a reproducible example:
import plotly.graph_objects as pgo
import numpy as np
import pandas as pd
layout = pgo.Layout(
height=600,
showlegend=False,
hovermode='closest',
title='Activity Overview',
xaxis1=dict(
domain=[0, 1],
rangeslider=dict(
visible=True
),
type='date'
),
xaxis2=dict(domain=[0, .33], tickangle=90),
xaxis3=dict(domain=[.34, .66], tickangle=90),
xaxis4=dict(domain=[.67, 1], tickangle=90),
yaxis1=dict(domain=[.5, 1], automargin=True),
yaxis2=dict(domain=[0, 0.4]),
yaxis3=dict(domain=[0, 0.4]),
yaxis4=dict(domain=[0, 0.4]),
)
traces = [
pgo.Scatter(
x=pd.date_range('2010-01-01', '2020-01-01'),
y=np.random.rand(len(pd.date_range('2010-01-01', '2020-01-01'))),
xaxis='x1', yaxis='y1',
mode='lines', name='',
),
pgo.Bar(
xaxis='x2', yaxis='y2',
x=np.arange(6),
y=np.random.rand(6),
name='',
),
pgo.Bar(
xaxis='x3', yaxis='y3',
x=np.arange(6),
y=np.random.rand(6),
name='',
),
pgo.Bar(
xaxis='x4', yaxis='y4',
x=np.arange(6),
y=np.random.rand(6),
name='',
)
]
fig = pgo.Figure(data=traces, layout=layout)
fig.show()
And here the result:
Does someone know how to fix this problem?
Thank you all!