-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplot.py
More file actions
28 lines (23 loc) · 648 Bytes
/
plot.py
File metadata and controls
28 lines (23 loc) · 648 Bytes
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
from typing import List
import plotly.graph_objs as go
from datetime import datetime
from plotly.offline import plot
def get_div(historic: (List[str], List[float]), scan: (List[str], List[float])):
data = [
go.Scatter(
x=historic[0],
y=historic[1],
mode='lines+markers',
name='Historic Glucose',
line=dict(
shape='spline'
)
),
go.Scatter(
x=scan[0],
y=scan[1],
mode='markers',
name='Scan Glucose'
),
]
return plot(data, include_plotlyjs='cdn', output_type='div')