Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions plots/plotly/scatter/line-basic/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,27 @@
Library: plotly
"""

import pandas as pd
import plotly.graph_objects as go


# Data
data = pd.DataFrame({"time": [1, 2, 3, 4, 5, 6, 7], "value": [10, 15, 13, 18, 22, 19, 25]})
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=data["time"], y=data["value"], mode="lines", line={"color": "#306998", "width": 2}, name="Value")
)
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": 20}},
title={"text": "Basic Line Plot", "font": {"size": 36}},
xaxis_title="Time",
yaxis_title="Value",
template="plotly_white",
xaxis={"title_font": {"size": 20}, "tickfont": {"size": 16}, "showgrid": True, "gridcolor": "rgba(0,0,0,0.1)"},
yaxis={"title_font": {"size": 20}, "tickfont": {"size": 16}, "showgrid": True, "gridcolor": "rgba(0,0,0,0.1)"},
legend={"font": {"size": 16}},
margin={"l": 80, "r": 40, "t": 80, "b": 60},
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
Expand Down
Loading