Skip to content

Commit 3e0273f

Browse files
feat(plotly): implement histogram-basic
- Basic histogram showing frequency distribution of numeric data - Uses Python Blue (#306998) color with 0.85 opacity - Scaled fonts for 4800x2700 resolution (title: 40pt, tick: 32pt) - Added hover template for interactivity - Outputs to plot.png at 4800x2700 pixels
1 parent 1d5bf65 commit 3e0273f

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

plots/plotly/histogram/histogram-basic/default.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@
1313

1414
# Create figure
1515
fig = go.Figure()
16-
fig.add_trace(go.Histogram(x=values, marker_color="#306998", opacity=0.8, nbinsx=30))
16+
fig.add_trace(
17+
go.Histogram(
18+
x=values, marker_color="#306998", opacity=0.85, hovertemplate="Range: %{x}<br>Count: %{y}<extra></extra>"
19+
)
20+
)
1721

1822
# Layout
1923
fig.update_layout(
20-
title={"text": "Basic Histogram", "font": {"size": 20}, "x": 0.5, "xanchor": "center"},
21-
xaxis_title="Value",
22-
yaxis_title="Frequency",
24+
title={"text": "Basic Histogram", "font": {"size": 40}, "x": 0.5, "xanchor": "center"},
25+
xaxis_title={"text": "Value", "font": {"size": 40}},
26+
yaxis_title={"text": "Frequency", "font": {"size": 40}},
2327
template="plotly_white",
24-
xaxis={"title_font": {"size": 20}, "tickfont": {"size": 16}},
25-
yaxis={"title_font": {"size": 20}, "tickfont": {"size": 16}},
28+
xaxis={"tickfont": {"size": 32}, "showgrid": True, "gridcolor": "rgba(0,0,0,0.1)"},
29+
yaxis={"tickfont": {"size": 32}, "showgrid": True, "gridcolor": "rgba(0,0,0,0.1)"},
2630
bargap=0.05,
2731
)
2832

0 commit comments

Comments
 (0)