-
Notifications
You must be signed in to change notification settings - Fork 1
/
plots.py
62 lines (55 loc) · 1.53 KB
/
plots.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
import plotly.offline as py
import plotly.graph_objs as go
plotly_layout = go.Layout(
xaxis=dict(
title='t[s]',
titlefont=dict(
family='Arial, sans-serif',
size=18,
color='lightgrey'
),
showticklabels=True,
tickfont=dict(
family='Old Standard TT, serif',
size=14,
color='black'
),
exponentformat='e',
showexponent='all'
),
yaxis=dict(
title='A[m]',
titlefont=dict(
family='Arial, sans-serif',
size=18,
color='lightgrey'
),
showticklabels=True,
tickfont=dict(
family='Old Standard TT, serif',
size=14,
color='black'
),
exponentformat='e',
showexponent='all'
)
)
def plot(graph):
data = [go.Scatter(
x=graph['x'],
y=graph['y'],
mode="markers"
)]
figure = go.Figure(data=data, layout=plotly_layout)
py.plot(figure, filename='graph')
def show_multiple_series(values):
layout = plotly_layout
data = []
for correlation in values:
data.append(go.Scatter(
x=list(range(len(correlation))),
y=correlation,
mode="markers" if True else 'lines',
))
figure = go.Figure(data=data, layout=layout)
py.plot(figure, filename='mgraph')