-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathlines.py
149 lines (146 loc) · 4.09 KB
/
lines.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import plotly.graph_objs as go
D = dict(
x1=[0, 1, 2, 3, 4, 5],
y1=[10, 20, 50, 80, 100, 200],
x2=[0, 1, 2, 3, 4, 5, 6],
y2=[1, 4, 8, 16, 32, 64, 128],
)
SIMPLE_LINE = go.Figure(
data=[
go.Scatter(
x=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0],
y=[10.0, 20.0, 50.0, 80.0, 100.0, 200.0],
name="simple",
mode="lines",
line=go.scatter.Line(
dash="solid", color="rgba (31, 119, 180, 1)", width=1.5
),
xaxis="x1",
yaxis="y1",
)
],
layout=go.Layout(
width=640,
height=480,
autosize=False,
margin=go.layout.Margin(l=80, r=63, b=52, t=57, pad=0),
hovermode="closest",
showlegend=False,
xaxis1=go.layout.XAxis(
domain=[0.0, 1.0],
range=[-0.25, 5.25],
type="linear",
showline=True,
ticks="inside",
nticks=8,
showgrid=False,
zeroline=False,
tickfont=dict(size=10.0),
anchor="y1",
side="bottom",
mirror="ticks",
),
yaxis1=go.layout.YAxis(
domain=[0.0, 1.0],
range=[0.5, 209.5],
type="linear",
showline=True,
ticks="inside",
nticks=10,
showgrid=False,
zeroline=False,
tickfont=dict(size=10.0),
anchor="x1",
side="left",
mirror="ticks",
),
),
)
COMPLICATED_LINE = go.Figure(
data=[
go.Scatter(
x=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0],
y=[10.0, 20.0, 50.0, 80.0, 100.0, 200.0],
name="one",
mode="markers",
marker=go.scatter.Marker(
symbol="circle",
line=dict(color="#FF0000", width=1.0),
size=10,
color="#FF0000",
opacity=0.5,
),
xaxis="x1",
yaxis="y1",
),
go.Scatter(
x=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0],
y=[10.0, 20.0, 50.0, 80.0, 100.0, 200.0],
name="two",
mode="lines",
line=dict(dash="solid", color="rgba (0, 0, 255, 0.7)", width=2),
xaxis="x1",
yaxis="y1",
),
go.Scatter(
x=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
y=[1.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0],
name="three",
mode="markers",
marker=go.scatter.Marker(
symbol="cross",
line=dict(color="#0000FF", width=2),
size=10,
color="#0000FF",
opacity=0.6,
),
xaxis="x1",
yaxis="y1",
),
go.Scatter(
x=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
y=[1.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0],
name="four",
mode="lines",
line=go.scatter.Line(dash="dash", color="rgba (255, 0, 0, 0.8)", width=2),
xaxis="x1",
yaxis="y1",
),
],
layout=go.Layout(
width=640,
height=480,
autosize=False,
margin=go.layout.Margin(l=80, r=63, b=52, t=57, pad=0),
hovermode="closest",
showlegend=False,
xaxis1=go.layout.XAxis(
domain=[0.0, 1.0],
range=[-0.30000000000000004, 6.2999999999999998],
type="linear",
showline=True,
ticks="inside",
nticks=9,
showgrid=False,
zeroline=False,
tickfont=dict(size=10.0),
anchor="y1",
side="bottom",
mirror="ticks",
),
yaxis1=go.layout.YAxis(
domain=[0.0, 1.0],
range=[-8.9500000000000011, 209.94999999999999],
type="linear",
showline=True,
ticks="inside",
nticks=11,
showgrid=False,
zeroline=False,
tickfont=dict(size=10.0),
anchor="x1",
side="left",
mirror="ticks",
),
),
)