Skip to content

Commit ef67878

Browse files
feat(matplotlib): implement histogram-basic
Implements basic histogram visualization using matplotlib's ax.hist() method. - Uses pandas DataFrame as per spec example - Follows Python Blue color from style guide (#306998) - Proper font sizes for 4800x2700 output (20pt labels, 16pt ticks) - Y-axis grid for readability
1 parent 4882920 commit ef67878

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

plots/matplotlib/hist/histogram-basic/default.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55

66
import matplotlib.pyplot as plt
77
import numpy as np
8+
import pandas as pd
89

910

1011
# Data
1112
np.random.seed(42)
12-
values = np.random.normal(100, 15, 500)
13+
data = pd.DataFrame({"value": np.random.normal(100, 15, 500)})
1314

1415
# Create plot
1516
fig, ax = plt.subplots(figsize=(16, 9))
16-
ax.hist(values, bins=30, alpha=0.8, color="#306998", edgecolor="white", linewidth=0.5)
17+
ax.hist(data["value"], bins=30, alpha=0.8, color="#306998", edgecolor="white", linewidth=0.5)
1718

1819
# Labels and styling
1920
ax.set_xlabel("Value", fontsize=20)

0 commit comments

Comments
 (0)