From 835699fc4a32e9328f90b43e244a0d6100be3d28 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sun, 7 Dec 2025 10:02:28 +0000 Subject: [PATCH] feat(plotly): implement line-basic - Use pandas DataFrame for data consistency with spec - Add margin configuration for proper layout - Configure legend settings --- plots/plotly/scatter/line-basic/default.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plots/plotly/scatter/line-basic/default.py b/plots/plotly/scatter/line-basic/default.py index a00d8cf2db..dff4e3245a 100644 --- a/plots/plotly/scatter/line-basic/default.py +++ b/plots/plotly/scatter/line-basic/default.py @@ -3,26 +3,29 @@ Library: plotly """ +import pandas as pd import plotly.graph_objects as go # Data -time = [1, 2, 3, 4, 5, 6, 7] -value = [10, 15, 13, 18, 22, 19, 25] +data = pd.DataFrame({"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": 2}, name="Value")) +fig.add_trace( + go.Scatter(x=data["time"], y=data["value"], mode="lines", line={"color": "#306998", "width": 2}, name="Value") +) # Layout fig.update_layout( - title={"text": "Basic Line Plot", "font": {"size": 20}, "x": 0.5}, + title={"text": "Basic Line Plot", "font": {"size": 20}}, xaxis_title="Time", yaxis_title="Value", - xaxis={"tickfont": {"size": 16}, "title_font": {"size": 20}, "gridcolor": "rgba(0,0,0,0.1)"}, - yaxis={"tickfont": {"size": 16}, "title_font": {"size": 20}, "gridcolor": "rgba(0,0,0,0.1)"}, template="plotly_white", - showlegend=False, + 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}, ) # Save