Skip to content

Commit f9a3f2d

Browse files
update(band-basic): matplotlib — comprehensive quality review
Comprehensive quality review of matplotlib band-basic implementation.
1 parent b634f35 commit f9a3f2d

4 files changed

Lines changed: 32 additions & 31 deletions

File tree

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,42 @@
1-
""" pyplots.ai
1+
"""pyplots.ai
22
band-basic: Basic Band Plot
3-
Library: matplotlib 3.10.8 | Python 3.13.11
4-
Quality: 93/100 | Created: 2025-12-23
3+
Library: matplotlib 3.10.8 | Python 3.14
4+
Quality: /100 | Updated: 2026-02-23
55
"""
66

77
import matplotlib.pyplot as plt
88
import numpy as np
99

1010

11-
# Data - Simulating a time series with 95% confidence interval
11+
# Data - Daily temperature forecast with 95% confidence interval
1212
np.random.seed(42)
13-
x = np.linspace(0, 10, 100)
13+
days = np.arange(1, 31)
1414

15-
# Central trend line (sinusoidal pattern with slight upward trend)
16-
y_center = 2 * np.sin(x) + 0.3 * x + 5
15+
# Central forecast: seasonal warming pattern peaking mid-month
16+
temp_forecast = 12 + 6 * np.sin(np.pi * days / 30) + 0.1 * days
1717

18-
# Confidence interval that widens over time (common in forecasting)
19-
uncertainty = 0.5 + 0.15 * x
20-
y_lower = y_center - uncertainty
21-
y_upper = y_center + uncertainty
18+
# Confidence interval widens further into the forecast (common in weather models)
19+
uncertainty = 0.8 + 0.12 * days
20+
temp_lower = temp_forecast - uncertainty
21+
temp_upper = temp_forecast + uncertainty
2222

2323
# Plot
2424
fig, ax = plt.subplots(figsize=(16, 9))
2525

26-
# Filled band (semi-transparent)
27-
ax.fill_between(x, y_lower, y_upper, alpha=0.3, color="#306998", label="95% Confidence Interval")
26+
ax.fill_between(days, temp_lower, temp_upper, alpha=0.25, color="#306998", label="95% Confidence Interval")
27+
ax.plot(days, temp_forecast, color="#306998", linewidth=3, label="Forecast Mean")
28+
ax.plot(days, temp_lower, color="#306998", linewidth=1.5, linestyle="--", alpha=0.5)
29+
ax.plot(days, temp_upper, color="#306998", linewidth=1.5, linestyle="--", alpha=0.5)
2830

29-
# Central trend line
30-
ax.plot(x, y_center, color="#306998", linewidth=3, label="Mean Trend")
31-
32-
# Boundary lines (subtle)
33-
ax.plot(x, y_lower, color="#306998", linewidth=1.5, linestyle="--", alpha=0.7)
34-
ax.plot(x, y_upper, color="#306998", linewidth=1.5, linestyle="--", alpha=0.7)
35-
36-
# Styling
37-
ax.set_xlabel("Time (s)", fontsize=20)
38-
ax.set_ylabel("Value", fontsize=20)
39-
ax.set_title("band-basic · matplotlib · pyplots.ai", fontsize=24)
31+
# Style
32+
ax.set_xlabel("Day of Month", fontsize=20)
33+
ax.set_ylabel("Temperature (\u00b0C)", fontsize=20)
34+
ax.set_title("band-basic \u00b7 matplotlib \u00b7 pyplots.ai", fontsize=24, fontweight="medium")
4035
ax.tick_params(axis="both", labelsize=16)
4136
ax.legend(fontsize=16, loc="upper left")
42-
ax.grid(True, alpha=0.3, linestyle="--")
37+
ax.spines["top"].set_visible(False)
38+
ax.spines["right"].set_visible(False)
39+
ax.yaxis.grid(True, alpha=0.2, linewidth=0.8)
4340

4441
plt.tight_layout()
4542
plt.savefig("plot.png", dpi=300, bbox_inches="tight")

plots/band-basic/metadata/matplotlib.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
library: matplotlib
22
specification_id: band-basic
33
created: '2025-12-23T09:08:22Z'
4-
updated: '2025-12-23T09:10:31Z'
5-
generated_by: claude-opus-4-5-20251101
4+
updated: '2026-02-23T13:40:00Z'
5+
generated_by: claude-opus-4-6
66
workflow_run: 20456381970
77
issue: 0
8-
python_version: 3.13.11
8+
python_version: '3.14'
99
library_version: 3.10.8
1010
preview_url: https://storage.googleapis.com/pyplots-images/plots/band-basic/matplotlib/plot.png
1111
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/band-basic/matplotlib/plot_thumb.png
1212
preview_html: null
13-
quality_score: 93
13+
quality_score: null
1414
impl_tags:
1515
dependencies: []
1616
techniques:

plots/band-basic/specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A band plot displays a filled region between two boundary lines, commonly used t
1616
- `x` (numeric) - Independent variable, often representing time or sequence
1717
- `y_lower` (numeric) - Lower boundary values defining the bottom of the band
1818
- `y_upper` (numeric) - Upper boundary values defining the top of the band
19-
- `y_center` (numeric, optional) - Central trend line values (mean/median)
19+
- `y_center` (numeric) - Central trend line values (mean/median), shown as a contrasting line
2020
- Size: 20-200 data points
2121
- Example: Time series with 95% confidence interval bounds
2222

plots/band-basic/specification.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: Basic Band Plot
66

77
# Specification tracking
88
created: 2025-12-15T20:42:54Z
9-
updated: 2025-12-15T20:42:54Z
9+
updated: 2026-02-23T12:00:00Z
1010
issue: 979
1111
suggested: MarkusNeusinger
1212

@@ -18,10 +18,14 @@ tags:
1818
data_type:
1919
- numeric
2020
- continuous
21+
- timeseries
2122
domain:
2223
- statistics
2324
- science
25+
- general
26+
- engineering
2427
features:
2528
- basic
2629
- confidence-interval
2730
- uncertainty
31+
- 2d

0 commit comments

Comments
 (0)