-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.py
More file actions
30 lines (24 loc) · 834 Bytes
/
default.py
File metadata and controls
30 lines (24 loc) · 834 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
29
30
"""
line-basic: Basic Line Plot
Library: plotly
"""
import plotly.graph_objects as go
# Data
time = [1, 2, 3, 4, 5, 6, 7]
value = [10, 15, 13, 18, 22, 19, 25]
# Create plot
fig = go.Figure()
fig.add_trace(go.Scatter(x=time, y=value, mode="lines", line={"color": "#306998", "width": 3}))
# Layout
fig.update_layout(
title={"text": "Basic Line Plot", "font": {"size": 36}},
xaxis_title="Time",
yaxis_title="Value",
template="plotly_white",
showlegend=False,
xaxis={"title_font": {"size": 28}, "tickfont": {"size": 22}, "showgrid": True, "gridcolor": "rgba(0,0,0,0.1)"},
yaxis={"title_font": {"size": 28}, "tickfont": {"size": 22}, "showgrid": True, "gridcolor": "rgba(0,0,0,0.1)"},
margin={"l": 80, "r": 40, "t": 100, "b": 80},
)
# Save
fig.write_image("plot.png", width=1600, height=900, scale=3)