-
Notifications
You must be signed in to change notification settings - Fork 0
/
aquarium_ph.py
32 lines (32 loc) · 898 Bytes
/
aquarium_ph.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
import plotly
import plotly.graph_objs as go
import pandas as pd
from plotly.graph_objs import Scatter, Layout
df = pd.read_csv("/var/www/html/aquarium/aquarium.csv")
data = [go.Scatter(
x=df.Date,
y=df['pH'])]
layout = go.Layout(
title='Aquarium pH',
xaxis=dict(
title='Time',
titlefont=dict(
family='Courier New, monospace',
size=30,
color='#7f7f7f'
)
),
yaxis=dict(
title='pH',
titlefont=dict(
family='Courier New, monospace',
size=30,
color='#7f7f7f'
)
)
)
fig = go.Figure(data=data, layout=layout)
plotly.offline.plot(fig,
filename='/var/www/html/aquarium/aquarium_ph.html',
auto_open=False)
print("Aquarium pH plotted")