-
Notifications
You must be signed in to change notification settings - Fork 4
/
scaleTest.py
42 lines (40 loc) · 1.35 KB
/
scaleTest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import plotly.graph_objects as go
import numpy as np
if __name__ == '__main__':
traces = []
layout = go.Layout(
barmode='stack',
xaxis=dict(
domain=[0, 0.9],
side='top'
),
yaxis=dict(
domain=[0, 1],
range=[0, 100]
),
xaxis2=dict(
domain=[0.9, 1],
anchor='y2',
range=[0, 1],
showgrid=False,
showticklabels=False
),
yaxis2=dict(
domain=[0, 1],
anchor='x2',
showgrid=False,
range=[0, 100]
),
)
y0 = np.random.rand(1000)*100
y1 = [25,25,20,25,15]
traces.append(go.Box(y=y0))
traces.append(go.Box(y=y0))
traces.append(go.Box(y=y0))
traces.append(go.Bar(y=[y1[0]], xaxis='x2', yaxis='y2', width=2, showlegend=False, hoverinfo='skip'))
traces.append(go.Bar(y=[y1[1]], xaxis='x2', yaxis='y2', width=2, showlegend=False, hoverinfo='skip'))
traces.append(go.Bar(y=[y1[2]], xaxis='x2', yaxis='y2', width=2, showlegend=False, hoverinfo='skip'))
traces.append(go.Bar(y=[y1[3]], xaxis='x2', yaxis='y2', width=2, showlegend=False, hoverinfo='skip'))
traces.append(go.Bar(y=[y1[4]], xaxis='x2', yaxis='y2', width=2, showlegend=False, hoverinfo='skip'))
fig = go.Figure(data=traces, layout=layout)
fig.show()