1import plotly.graph_objects as go
2
3import numpy as np
4
5x0 = np.random.randn(2000)
6x1 = np.random.randn(2000) + 1
7
8fig = go.Figure()
9fig.add_trace(go.Histogram(x=x0))
10fig.add_trace(go.Histogram(x=x1))
11
12# The two histograms are drawn on top of another
13fig.update_layout(barmode='stack')
14
15fig.update_layout(title='<b>Title</b>',
16 xaxis_title='<b>x</b>',
17 yaxis_title='<b>y</b>')
18fig.show()