From 3701f6e9d65339b84fe796f91b72782f92b01e2a Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Mon, 23 Feb 2026 14:50:15 +0100 Subject: [PATCH 1/6] =?UTF-8?q?update(band-basic):=20altair=20=E2=80=94=20?= =?UTF-8?q?comprehensive=20quality=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comprehensive quality review of altair band-basic implementation. --- plots/band-basic/implementations/altair.py | 14 ++++++++------ plots/band-basic/metadata/altair.yaml | 8 ++++---- plots/band-basic/specification.md | 2 +- plots/band-basic/specification.yaml | 6 +++++- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/plots/band-basic/implementations/altair.py b/plots/band-basic/implementations/altair.py index ddee174975..b756877749 100644 --- a/plots/band-basic/implementations/altair.py +++ b/plots/band-basic/implementations/altair.py @@ -1,7 +1,7 @@ -""" pyplots.ai +"""pyplots.ai band-basic: Basic Band Plot -Library: altair 6.0.0 | Python 3.13.11 -Quality: 92/100 | Created: 2025-12-23 +Library: altair 6.0.0 | Python 3.14 +Quality: /100 | Updated: 2026-02-23 """ import altair as alt @@ -25,17 +25,19 @@ band = ( alt.Chart(df) .mark_area(opacity=0.3, color="#306998") - .encode(x=alt.X("x:Q", title="Time (s)"), y=alt.Y("y_lower:Q", title="Signal Amplitude"), y2=alt.Y2("y_upper:Q")) + .encode( + x=alt.X("x:Q", title="Time (s)"), y=alt.Y("y_lower:Q", title="Signal Amplitude (mV)"), y2=alt.Y2("y_upper:Q") + ) ) # Central trend line -line = alt.Chart(df).mark_line(strokeWidth=4, color="#306998").encode(x="x:Q", y="y_center:Q") +line = alt.Chart(df).mark_line(strokeWidth=2.5, color="#306998").encode(x="x:Q", y="y_center:Q") # Combine band and line chart = ( (band + line) .properties(width=1600, height=900, title=alt.Title("band-basic · altair · pyplots.ai", fontSize=28)) - .configure_axis(labelFontSize=18, titleFontSize=22, gridOpacity=0.3) + .configure_axis(labelFontSize=18, titleFontSize=22, gridOpacity=0.2) .configure_view(strokeWidth=0) ) diff --git a/plots/band-basic/metadata/altair.yaml b/plots/band-basic/metadata/altair.yaml index 43cbe1b1fa..20db7f6587 100644 --- a/plots/band-basic/metadata/altair.yaml +++ b/plots/band-basic/metadata/altair.yaml @@ -1,16 +1,16 @@ library: altair specification_id: band-basic created: '2025-12-23T09:10:02Z' -updated: '2025-12-23T09:12:07Z' -generated_by: claude-opus-4-5-20251101 +updated: '2026-02-23T13:40:00Z' +generated_by: claude-opus-4-6 workflow_run: 20456385370 issue: 0 -python_version: 3.13.11 +python_version: '3.14' library_version: 6.0.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot.html -quality_score: 92 +quality_score: null impl_tags: dependencies: [] techniques: diff --git a/plots/band-basic/specification.md b/plots/band-basic/specification.md index 4614c2a26c..a18f9caee9 100644 --- a/plots/band-basic/specification.md +++ b/plots/band-basic/specification.md @@ -16,7 +16,7 @@ A band plot displays a filled region between two boundary lines, commonly used t - `x` (numeric) - Independent variable, often representing time or sequence - `y_lower` (numeric) - Lower boundary values defining the bottom of the band - `y_upper` (numeric) - Upper boundary values defining the top of the band -- `y_center` (numeric, optional) - Central trend line values (mean/median) +- `y_center` (numeric) - Central trend line values (mean/median), shown as a contrasting line - Size: 20-200 data points - Example: Time series with 95% confidence interval bounds diff --git a/plots/band-basic/specification.yaml b/plots/band-basic/specification.yaml index c239433ec4..76a86a91e9 100644 --- a/plots/band-basic/specification.yaml +++ b/plots/band-basic/specification.yaml @@ -6,7 +6,7 @@ title: Basic Band Plot # Specification tracking created: 2025-12-15T20:42:54Z -updated: 2025-12-15T20:42:54Z +updated: 2026-02-23T12:00:00Z issue: 979 suggested: MarkusNeusinger @@ -18,10 +18,14 @@ tags: data_type: - numeric - continuous + - timeseries domain: - statistics - science + - general + - engineering features: - basic - confidence-interval - uncertainty + - 2d From 84bbfd43380dd93e3b4d560def27c80f22cbf7f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 13:55:14 +0000 Subject: [PATCH 2/6] chore(altair): update quality score 86 and review feedback for band-basic --- plots/band-basic/implementations/altair.py | 4 +- plots/band-basic/metadata/altair.yaml | 241 +++++++++++---------- 2 files changed, 129 insertions(+), 116 deletions(-) diff --git a/plots/band-basic/implementations/altair.py b/plots/band-basic/implementations/altair.py index b756877749..82e724e779 100644 --- a/plots/band-basic/implementations/altair.py +++ b/plots/band-basic/implementations/altair.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai band-basic: Basic Band Plot Library: altair 6.0.0 | Python 3.14 -Quality: /100 | Updated: 2026-02-23 +Quality: 86/100 | Updated: 2026-02-23 """ import altair as alt diff --git a/plots/band-basic/metadata/altair.yaml b/plots/band-basic/metadata/altair.yaml index 20db7f6587..37d7295272 100644 --- a/plots/band-basic/metadata/altair.yaml +++ b/plots/band-basic/metadata/altair.yaml @@ -1,7 +1,7 @@ library: altair specification_id: band-basic created: '2025-12-23T09:10:02Z' -updated: '2026-02-23T13:40:00Z' +updated: '2026-02-23T13:55:14Z' generated_by: claude-opus-4-6 workflow_run: 20456385370 issue: 0 @@ -10,157 +10,163 @@ library_version: 6.0.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot.html -quality_score: null +quality_score: 86 impl_tags: dependencies: [] techniques: - - html-export - layer-composition + - html-export patterns: - data-generation dataprep: [] styling: - alpha-blending + - grid-styling review: strengths: - - Excellent use of Altair declarative grammar with mark_area and y/y2 encoding for - the band - - Clean layered composition combining band and line charts - - Realistic uncertainty growth pattern (band widens over time) demonstrates practical - use case - - Proper 95% confidence interval calculation using 1.96 * uncertainty - - Good visual hierarchy with semi-transparent band (opacity=0.3) and prominent center - line (strokeWidth=4) - - Correct output format with both PNG and HTML for Altair + - Perfect visual quality with all font sizes explicitly set and no overlap issues + - Correct title format and descriptive axis labels with appropriate units + - Realistic scientific data context with widening confidence intervals demonstrating + band utility + - Clean, idiomatic Altair code with proper KISS structure + - Good use of Y2 encoding for the band area, which is a distinctive Altair feature weaknesses: - - Y-axis label Signal Amplitude lacks units (should include units like mV) - - No legend or annotation explaining what the band represents (e.g. 95% CI) - image_description: The plot displays a band plot with a light blue semi-transparent - confidence band between two boundary lines, with a solid dark blue central trend - line running through the middle. The band shows a sinusoidal pattern with linear - upward growth, with amplitude ranging from approximately -3 to 10 on the y-axis. - The x-axis shows "Time (s)" from 0.0 to 10.0, and the y-axis shows "Signal Amplitude". - The confidence band appropriately widens over time (from ~1.0 at t=0 to ~3.5 at - t=10), demonstrating realistic uncertainty growth. The title "band-basic · altair - · pyplots.ai" is displayed at the top. The plot has a clean white background with - subtle gray gridlines. + - Design stays at configured-default level with single Python Blue color for both + band and line + - No visual hierarchy or data storytelling beyond what the data inherently shows + - Central line uses same color (#306998) as the band — a darker shade would create + stronger visual separation + - Does not leverage Altair interactive capabilities (tooltips, zoom/pan) in the + HTML export + image_description: The plot displays a band chart on a white background with a light + blue semi-transparent filled region (confidence band) between upper and lower + boundaries, and a darker blue central trend line running through the middle. The + x-axis is labeled "Time (s)" ranging from 0.0 to 10.0 with tick marks at 0.4 intervals. + The y-axis is labeled "Signal Amplitude (mV)" ranging from approximately -3.0 + to 10.0. The title "band-basic · altair · pyplots.ai" appears at the top in a + large font. The central line follows a sinusoidal pattern with upward linear growth, + creating two peaks (around x=1.8 and x=8.0) and a trough (around x=4.5). The confidence + band widens progressively from left to right, starting narrow (~1 mV wide) at + x=0 and expanding to ~4 mV wide at x=10, realistically depicting growing uncertainty + over time. The grid is very subtle (low opacity) and view borders are removed, + giving a clean appearance. criteria_checklist: visual_quality: - score: 37 - max: 40 + score: 30 + max: 30 items: - id: VQ-01 name: Text Legibility - score: 10 - max: 10 + score: 8 + max: 8 passed: true - comment: Title at 28pt, axis labels at 22pt, tick labels at 18pt - all perfectly - readable + comment: 'All font sizes explicitly set: title=28pt, axis labels=22pt, ticks=18pt' - id: VQ-02 name: No Overlap - score: 8 - max: 8 + score: 6 + max: 6 passed: true - comment: No overlapping text elements + comment: No overlapping text elements, tick labels well-spaced - id: VQ-03 name: Element Visibility - score: 8 - max: 8 + score: 6 + max: 6 passed: true - comment: Band opacity (0.3) allows visibility, line width (4) makes central - trend clear + comment: Band visible at 0.3 opacity, central line at strokeWidth=2.5 is distinct - id: VQ-04 name: Color Accessibility - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: Single color scheme (#306998 blue) with good contrast + comment: Single Python Blue hue, no colorblind issues, good contrast - id: VQ-05 - name: Layout Balance - score: 5 - max: 5 + name: Layout & Canvas + score: 4 + max: 4 passed: true - comment: Good proportions, 16:9 aspect ratio, no cut-off content + comment: Plot fills canvas well, balanced margins, nothing cut off - id: VQ-06 - name: Axis Labels - score: 1 + name: Axis Labels & Title + score: 2 max: 2 passed: true - comment: Y-axis "Signal Amplitude" is descriptive but lacks units - - id: VQ-07 - name: Grid & Legend - score: 0 - max: 2 + comment: 'Descriptive labels with units: Time (s), Signal Amplitude (mV)' + design_excellence: + score: 10 + max: 20 + items: + - id: DE-01 + name: Aesthetic Sophistication + score: 4 + max: 8 + passed: false + comment: Well-configured default with Python Blue, single-color scheme lacks + sophistication + - id: DE-02 + name: Visual Refinement + score: 4 + max: 6 passed: true - comment: Grid is subtle (alpha 0.3) but no legend explaining what the band - represents + comment: View strokes removed, grid opacity 0.2, intentional refinement beyond + defaults + - id: DE-03 + name: Data Storytelling + score: 2 + max: 6 + passed: false + comment: Data displayed without visual hierarchy or emphasis guiding the viewer spec_compliance: - score: 25 - max: 25 + score: 15 + max: 15 items: - id: SC-01 name: Plot Type - score: 8 - max: 8 - passed: true - comment: Correct band/area plot with central trend line - - id: SC-02 - name: Data Mapping score: 5 max: 5 passed: true - comment: x mapped to time, y_lower/y_upper define band, y_center defines trend - line - - id: SC-03 + comment: Correct band plot with filled region and central trend line + - id: SC-02 name: Required Features - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: Has band with semi-transparent fill, central trend line in contrasting - style, smooth interpolation - - id: SC-04 - name: Data Range + comment: Semi-transparent fill, central line, smooth interpolation, 100 data + points + - id: SC-03 + name: Data Mapping score: 3 max: 3 passed: true - comment: All data points visible within axes - - id: SC-05 - name: Legend Accuracy - score: 2 - max: 2 - passed: true - comment: N/A for single-color band plot (no legend needed for basic version) - - id: SC-06 - name: Title Format - score: 2 - max: 2 + comment: X maps to time, Y maps to signal amplitude, band boundaries correct + - id: SC-04 + name: Title & Legend + score: 3 + max: 3 passed: true - comment: 'Correct format: "band-basic · altair · pyplots.ai"' + comment: Correct title format, no legend needed for single series data_quality: - score: 18 - max: 20 + score: 14 + max: 15 items: - id: DQ-01 name: Feature Coverage - score: 7 - max: 8 + score: 5 + max: 6 passed: true - comment: Shows widening uncertainty over time, sinusoidal pattern with linear - growth - demonstrates most band plot features but could show additional - scenarios + comment: Shows sinusoidal + linear trend, widening uncertainty, peaks and + troughs - id: DQ-02 name: Realistic Context - score: 7 - max: 7 + score: 5 + max: 5 passed: true - comment: Time series with 95% confidence interval - plausible scientific/engineering - scenario + comment: Signal amplitude in mV with 95% CI — plausible scientific context - id: DQ-03 name: Appropriate Scale score: 4 - max: 5 + max: 4 passed: true - comment: Values are reasonable for signal amplitude but units are abstract + comment: mV range and time in seconds realistic for electronic signals code_quality: score: 10 max: 10 @@ -170,40 +176,47 @@ review: score: 3 max: 3 passed: true - comment: Clean imports → data → plot → save structure, no functions/classes + comment: Clean Imports → Data → Plot → Save, no functions or classes - id: CQ-02 name: Reproducibility - score: 3 - max: 3 + score: 2 + max: 2 passed: true - comment: np.random.seed(42) ensures reproducibility + comment: np.random.seed(42) set, data is deterministic - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: Only altair, numpy, pandas imported - all used + comment: All imports (altair, numpy, pandas) are used - id: CQ-04 - name: No Deprecated API - score: 1 - max: 1 + name: Code Elegance + score: 2 + max: 2 passed: true - comment: Uses current Altair API + comment: Clean, concise Pythonic code with good layer composition - id: CQ-05 - name: Output Correct + name: Output & API score: 1 max: 1 passed: true - comment: Saves as plot.png and plot.html - library_features: - score: 5 - max: 5 + comment: Saves as plot.png and plot.html, current Altair 6.x API + library_mastery: + score: 7 + max: 10 items: - - id: LF-01 - name: Distinctive Features - score: 5 + - id: LM-01 + name: Idiomatic Usage + score: 4 max: 5 passed: true - comment: Excellent use of Altair's declarative approach with mark_area, y/y2 - encoding for bands, layered composition (band + line), configure_* for styling - verdict: APPROVED + comment: Good use of mark_area/mark_line, alt.X/Y/Y2, layer composition, configure + chain + - id: LM-02 + name: Distinctive Features + score: 3 + max: 5 + passed: false + comment: Y2 encoding and + layer composition distinctive but doesn't leverage + interactive features + verdict: REJECTED From 9a01c9d44c91192009ab670ba3803280a7e46249 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 14:04:21 +0000 Subject: [PATCH 3/6] fix(altair): address review feedback for band-basic Attempt 1/3 - fixes based on AI review --- plots/band-basic/implementations/altair.py | 64 +++++++++++++++++++--- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/plots/band-basic/implementations/altair.py b/plots/band-basic/implementations/altair.py index 82e724e779..aaca3762c5 100644 --- a/plots/band-basic/implementations/altair.py +++ b/plots/band-basic/implementations/altair.py @@ -1,4 +1,4 @@ -""" pyplots.ai +"""pyplots.ai band-basic: Basic Band Plot Library: altair 6.0.0 | Python 3.14 Quality: 86/100 | Updated: 2026-02-23 @@ -18,24 +18,70 @@ uncertainty = 0.5 + 0.15 * x y_lower = y_center - 1.96 * uncertainty y_upper = y_center + 1.96 * uncertainty +y_inner_lower = y_center - 0.674 * uncertainty # 50% CI inner band +y_inner_upper = y_center + 0.674 * uncertainty -df = pd.DataFrame({"x": x, "y_center": y_center, "y_lower": y_lower, "y_upper": y_upper}) +df = pd.DataFrame( + { + "x": x, + "y_center": y_center, + "y_lower": y_lower, + "y_upper": y_upper, + "y_inner_lower": y_inner_lower, + "y_inner_upper": y_inner_upper, + } +) + +# Nearest-point selection for interactive HTML export +nearest = alt.selection_point(nearest=True, on="pointerover", fields=["x"], empty=False) -# Band (area between y_lower and y_upper) -band = ( +# 95% confidence band (outer, lighter) +band_outer = ( alt.Chart(df) - .mark_area(opacity=0.3, color="#306998") + .mark_area(opacity=0.2, color="#306998", interpolate="monotone") .encode( x=alt.X("x:Q", title="Time (s)"), y=alt.Y("y_lower:Q", title="Signal Amplitude (mV)"), y2=alt.Y2("y_upper:Q") ) ) -# Central trend line -line = alt.Chart(df).mark_line(strokeWidth=2.5, color="#306998").encode(x="x:Q", y="y_center:Q") +# 50% confidence band (inner, creates gradient depth) +band_inner = ( + alt.Chart(df) + .mark_area(opacity=0.2, color="#306998", interpolate="monotone") + .encode(x="x:Q", y="y_inner_lower:Q", y2="y_inner_upper:Q") +) + +# Central trend line (darker navy for strong contrast) +line = alt.Chart(df).mark_line(strokeWidth=2.5, color="#1a3a5c", interpolate="monotone").encode(x="x:Q", y="y_center:Q") + +# Interactive tooltip points (visible only on hover in HTML) +tooltip_points = ( + alt.Chart(df) + .mark_point(color="#1a3a5c", size=80) + .encode( + x="x:Q", + y="y_center:Q", + opacity=alt.condition(nearest, alt.value(1), alt.value(0)), + tooltip=[ + alt.Tooltip("x:Q", title="Time (s)", format=".1f"), + alt.Tooltip("y_center:Q", title="Signal (mV)", format=".2f"), + alt.Tooltip("y_lower:Q", title="95% CI Lower", format=".2f"), + alt.Tooltip("y_upper:Q", title="95% CI Upper", format=".2f"), + ], + ) + .add_params(nearest) +) + +# Vertical guide rule (visible only on hover in HTML) +guide_rule = ( + alt.Chart(df) + .mark_rule(color="#999999", strokeDash=[4, 4]) + .encode(x="x:Q", opacity=alt.condition(nearest, alt.value(0.5), alt.value(0))) +) -# Combine band and line +# Combine layers chart = ( - (band + line) + (band_outer + band_inner + line + tooltip_points + guide_rule) .properties(width=1600, height=900, title=alt.Title("band-basic · altair · pyplots.ai", fontSize=28)) .configure_axis(labelFontSize=18, titleFontSize=22, gridOpacity=0.2) .configure_view(strokeWidth=0) From 6861080f23a7f8d343b928e357d56b38c5a86845 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 14:11:20 +0000 Subject: [PATCH 4/6] chore(altair): update quality score 88 and review feedback for band-basic --- plots/band-basic/implementations/altair.py | 4 +- plots/band-basic/metadata/altair.yaml | 144 +++++++++++---------- 2 files changed, 79 insertions(+), 69 deletions(-) diff --git a/plots/band-basic/implementations/altair.py b/plots/band-basic/implementations/altair.py index aaca3762c5..38ae262244 100644 --- a/plots/band-basic/implementations/altair.py +++ b/plots/band-basic/implementations/altair.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai band-basic: Basic Band Plot Library: altair 6.0.0 | Python 3.14 -Quality: 86/100 | Updated: 2026-02-23 +Quality: 88/100 | Updated: 2026-02-23 """ import altair as alt diff --git a/plots/band-basic/metadata/altair.yaml b/plots/band-basic/metadata/altair.yaml index 37d7295272..d8cf2fc3bd 100644 --- a/plots/band-basic/metadata/altair.yaml +++ b/plots/band-basic/metadata/altair.yaml @@ -1,7 +1,7 @@ library: altair specification_id: band-basic created: '2025-12-23T09:10:02Z' -updated: '2026-02-23T13:55:14Z' +updated: '2026-02-23T14:11:19Z' generated_by: claude-opus-4-6 workflow_run: 20456385370 issue: 0 @@ -10,11 +10,12 @@ library_version: 6.0.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot.html -quality_score: 86 +quality_score: 88 impl_tags: dependencies: [] techniques: - layer-composition + - hover-tooltips - html-export patterns: - data-generation @@ -24,35 +25,34 @@ impl_tags: - grid-styling review: strengths: - - Perfect visual quality with all font sizes explicitly set and no overlap issues - - Correct title format and descriptive axis labels with appropriate units - - Realistic scientific data context with widening confidence intervals demonstrating - band utility - - Clean, idiomatic Altair code with proper KISS structure - - Good use of Y2 encoding for the band area, which is a distinctive Altair feature + - Dual confidence bands (50% + 95% CI) creating layered visual depth — exceeds spec + requirements + - 'Excellent Altair idioms: declarative layer composition, selection/condition for + interactivity, y2 encoding' + - Clean monochromatic color palette with consistent Python Blue theme + - Growing uncertainty bands convey realistic time-series behavior + - Dual output (PNG + HTML) leverages Altair web-native strengths + - All font sizes explicitly configured for readability weaknesses: - - Design stays at configured-default level with single Python Blue color for both - band and line - - No visual hierarchy or data storytelling beyond what the data inherently shows - - Central line uses same color (#306998) as the band — a darker shade would create - stronger visual separation - - Does not leverage Altair interactive capabilities (tooltips, zoom/pan) in the - HTML export - image_description: The plot displays a band chart on a white background with a light - blue semi-transparent filled region (confidence band) between upper and lower - boundaries, and a darker blue central trend line running through the middle. The - x-axis is labeled "Time (s)" ranging from 0.0 to 10.0 with tick marks at 0.4 intervals. - The y-axis is labeled "Signal Amplitude (mV)" ranging from approximately -3.0 - to 10.0. The title "band-basic · altair · pyplots.ai" appears at the top in a - large font. The central line follows a sinusoidal pattern with upward linear growth, - creating two peaks (around x=1.8 and x=8.0) and a trough (around x=4.5). The confidence - band widens progressively from left to right, starting narrow (~1 mV wide) at - x=0 and expanding to ~4 mV wide at x=10, realistically depicting growing uncertainty - over time. The grid is very subtle (low opacity) and view borders are removed, - giving a clean appearance. + - Design sophistication limited by monochromatic-only approach — needs richer visual + treatment + - No visual emphasis or focal point to guide viewer attention to growing uncertainty + - Outer band edges quite faint at 0.2 opacity reducing visual clarity at extremes + - Data context is somewhat generic — a more specific scenario would improve realism + image_description: 'The plot displays a band chart titled "band-basic · altair · + pyplots.ai" with a dark navy central trend line showing a sinusoidal pattern combined + with linear growth (from ~0 at x=0 to ~4 at x=10). Two semi-transparent blue bands + surround the central line: an inner narrower band (50% CI) with medium blue opacity + and an outer wider band (95% CI) with lighter blue opacity. Both bands widen progressively + from left to right, demonstrating growing uncertainty over time. The x-axis is + labeled "Time (s)" ranging from 0.0 to 10.0, and the y-axis is labeled "Signal + Amplitude (mV)" ranging from approximately -3.0 to 10.0. The grid is very subtle + (low opacity), the view border is removed, and all text is clearly readable. The + color scheme is monochromatic blue throughout (#306998 for bands, #1a3a5c for + the line).' criteria_checklist: visual_quality: - score: 30 + score: 29 max: 30 items: - id: VQ-01 @@ -60,61 +60,65 @@ review: score: 8 max: 8 passed: true - comment: 'All font sizes explicitly set: title=28pt, axis labels=22pt, ticks=18pt' + comment: 'All font sizes explicitly set: title=28pt, axis titles=22pt, tick + labels=18pt. All clearly readable.' - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No overlapping text elements, tick labels well-spaced + comment: No overlapping text elements. Tick labels well-spaced on both axes. - id: VQ-03 name: Element Visibility - score: 6 + score: 5 max: 6 passed: true - comment: Band visible at 0.3 opacity, central line at strokeWidth=2.5 is distinct + comment: Central line and inner band clearly visible. Outer band edges are + quite faint at 0.2 opacity. - id: VQ-04 name: Color Accessibility score: 4 max: 4 passed: true - comment: Single Python Blue hue, no colorblind issues, good contrast + comment: Monochromatic blue scheme is inherently colorblind-safe with good + contrast. - id: VQ-05 name: Layout & Canvas score: 4 max: 4 passed: true - comment: Plot fills canvas well, balanced margins, nothing cut off + comment: Plot fills canvas well at 1600x900 (16:9). Balanced margins. - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: 'Descriptive labels with units: Time (s), Signal Amplitude (mV)' + comment: Time (s) and Signal Amplitude (mV) — descriptive with units. design_excellence: - score: 10 + score: 12 max: 20 items: - id: DE-01 name: Aesthetic Sophistication - score: 4 + score: 5 max: 8 passed: false - comment: Well-configured default with Python Blue, single-color scheme lacks - sophistication + comment: Cohesive monochromatic blue palette with dual CI bands. Above defaults + but fundamentally one color at different opacities. - id: DE-02 name: Visual Refinement score: 4 max: 6 passed: true - comment: View strokes removed, grid opacity 0.2, intentional refinement beyond - defaults + comment: View strokes removed, grid opacity at 0.2, monotone interpolation. + Good refinement. - id: DE-03 name: Data Storytelling - score: 2 + score: 3 max: 6 passed: false - comment: Data displayed without visual hierarchy or emphasis guiding the viewer + comment: Widening uncertainty bands implicitly communicate growing uncertainty + but no explicit focal point or emphasis. spec_compliance: score: 15 max: 15 @@ -124,28 +128,30 @@ review: score: 5 max: 5 passed: true - comment: Correct band plot with filled region and central trend line + comment: Correct band plot with filled region and central trend line. Exceeds + spec with dual-band CI. - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: Semi-transparent fill, central line, smooth interpolation, 100 data - points + comment: Semi-transparent fill, central line in contrasting color, smooth + monotone interpolation, 100 data points. - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: X maps to time, Y maps to signal amplitude, band boundaries correct + comment: X=time, Y=signal amplitude. Axes show full data range. - id: SC-04 name: Title & Legend score: 3 max: 3 passed: true - comment: Correct title format, no legend needed for single series + comment: Title in correct format. No legend needed for single-series band + plot. data_quality: - score: 14 + score: 13 max: 15 items: - id: DQ-01 @@ -153,20 +159,22 @@ review: score: 5 max: 6 passed: true - comment: Shows sinusoidal + linear trend, widening uncertainty, peaks and - troughs + comment: Shows widening CI, dual confidence bands, sinusoidal pattern with + linear growth. Covers band plot features well. - id: DQ-02 name: Realistic Context - score: 5 + score: 4 max: 5 passed: true - comment: Signal amplitude in mV with 95% CI — plausible scientific context + comment: Signal amplitude in mV is plausible scientific scenario. Somewhat + generic — more specific domain would strengthen it. - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: mV range and time in seconds realistic for electronic signals + comment: Signal in millivolt range, time in seconds, uncertainty scaling factor + — all realistic. code_quality: score: 10 max: 10 @@ -176,47 +184,49 @@ review: score: 3 max: 3 passed: true - comment: Clean Imports → Data → Plot → Save, no functions or classes + comment: Clean Imports → Data → Plot layers → Combine → Save structure. - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: np.random.seed(42) set, data is deterministic + comment: np.random.seed(42) set. Data is deterministic. - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: All imports (altair, numpy, pandas) are used + comment: All three imports used. - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Clean, concise Pythonic code with good layer composition + comment: Clean, well-organized. Interactive elements are legitimate Altair + features. - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves as plot.png and plot.html, current Altair 6.x API + comment: Saves as plot.png with scale_factor=3.0 and plot.html. Current Altair + 6.x API. library_mastery: - score: 7 + score: 9 max: 10 items: - id: LM-01 name: Idiomatic Usage - score: 4 + score: 5 max: 5 passed: true - comment: Good use of mark_area/mark_line, alt.X/Y/Y2, layer composition, configure - chain + comment: Declarative layered composition, proper encoding types, mark_area + with y/y2, configure_axis/configure_view. - id: LM-02 name: Distinctive Features - score: 3 + score: 4 max: 5 - passed: false - comment: Y2 encoding and + layer composition distinctive but doesn't leverage - interactive features + passed: true + comment: Uses selection_point, alt.condition, alt.Tooltip, y2 encoding, HTML + export. Interactive features invisible in PNG. verdict: REJECTED From cf6d15a0e9807131c0e553395f4572f74d1f6707 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 14:18:48 +0000 Subject: [PATCH 5/6] fix(altair): address review feedback for band-basic Attempt 2/3 - fixes based on AI review --- plots/band-basic/implementations/altair.py | 48 ++++++++++++++++------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/plots/band-basic/implementations/altair.py b/plots/band-basic/implementations/altair.py index 38ae262244..f1d84c02fb 100644 --- a/plots/band-basic/implementations/altair.py +++ b/plots/band-basic/implementations/altair.py @@ -1,7 +1,6 @@ -""" pyplots.ai +"""pyplots.ai band-basic: Basic Band Plot Library: altair 6.0.0 | Python 3.14 -Quality: 88/100 | Updated: 2026-02-23 """ import altair as alt @@ -9,12 +8,12 @@ import pandas as pd -# Data - Time series with 95% confidence interval +# Data - Oscilloscope voltage measurement with growing uncertainty np.random.seed(42) x = np.linspace(0, 10, 100) y_center = 2 * np.sin(x) + 0.5 * x # Central trend (sinusoidal + linear growth) -# Confidence band widens over time (realistic uncertainty growth) +# Confidence band widens over time (realistic sensor drift uncertainty) uncertainty = 0.5 + 0.15 * x y_lower = y_center - 1.96 * uncertainty y_upper = y_center + 1.96 * uncertainty @@ -32,28 +31,53 @@ } ) +# Annotation data — callout at x≈9.0 s where uncertainty is wide and clearly visible +ann_row = df.iloc[90] # x ≈ 9.09 +ann_df = pd.DataFrame( + { + "x": [ann_row["x"]], + "y_upper": [ann_row["y_upper"]], + "y_lower": [ann_row["y_lower"]], + "y_mid": [(ann_row["y_upper"] + ann_row["y_lower"]) / 2], + "label": [f"95% CI: ±{(ann_row['y_upper'] - ann_row['y_lower']) / 2:.1f} mV"], + } +) + # Nearest-point selection for interactive HTML export nearest = alt.selection_point(nearest=True, on="pointerover", fields=["x"], empty=False) -# 95% confidence band (outer, lighter) +# 95% confidence band (outer) — teal-shifted blue for visual depth against inner band band_outer = ( alt.Chart(df) - .mark_area(opacity=0.2, color="#306998", interpolate="monotone") + .mark_area(opacity=0.25, color="#4a8db7", interpolate="monotone") .encode( - x=alt.X("x:Q", title="Time (s)"), y=alt.Y("y_lower:Q", title="Signal Amplitude (mV)"), y2=alt.Y2("y_upper:Q") + x=alt.X("x:Q", title="Time (s)"), y=alt.Y("y_lower:Q", title="Oscilloscope Signal (mV)"), y2=alt.Y2("y_upper:Q") ) ) -# 50% confidence band (inner, creates gradient depth) +# 50% confidence band (inner) — deeper saturated blue for layered contrast band_inner = ( alt.Chart(df) - .mark_area(opacity=0.2, color="#306998", interpolate="monotone") + .mark_area(opacity=0.3, color="#306998", interpolate="monotone") .encode(x="x:Q", y="y_inner_lower:Q", y2="y_inner_upper:Q") ) -# Central trend line (darker navy for strong contrast) +# Central trend line (dark navy for strong focal contrast) line = alt.Chart(df).mark_line(strokeWidth=2.5, color="#1a3a5c", interpolate="monotone").encode(x="x:Q", y="y_center:Q") +# Annotation: vertical bracket showing uncertainty span +ann_rule = ( + alt.Chart(ann_df) + .mark_rule(color="#c0392b", strokeWidth=1.5, strokeDash=[6, 3]) + .encode(x="x:Q", y="y_lower:Q", y2="y_upper:Q") +) + +ann_text = ( + alt.Chart(ann_df) + .mark_text(align="left", dx=10, fontSize=16, fontWeight="bold", color="#c0392b") + .encode(x="x:Q", y="y_mid:Q", text="label:N") +) + # Interactive tooltip points (visible only on hover in HTML) tooltip_points = ( alt.Chart(df) @@ -81,9 +105,9 @@ # Combine layers chart = ( - (band_outer + band_inner + line + tooltip_points + guide_rule) + (band_outer + band_inner + line + ann_rule + ann_text + tooltip_points + guide_rule) .properties(width=1600, height=900, title=alt.Title("band-basic · altair · pyplots.ai", fontSize=28)) - .configure_axis(labelFontSize=18, titleFontSize=22, gridOpacity=0.2) + .configure_axis(labelFontSize=18, titleFontSize=22, gridOpacity=0.15, gridColor="#cccccc") .configure_view(strokeWidth=0) ) From f49749ca99cf2c0f180a310fb2c1ec3bded6f696 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 14:27:16 +0000 Subject: [PATCH 6/6] chore(altair): update quality score 94 and review feedback for band-basic --- plots/band-basic/implementations/altair.py | 3 +- plots/band-basic/metadata/altair.yaml | 155 +++++++++++---------- 2 files changed, 81 insertions(+), 77 deletions(-) diff --git a/plots/band-basic/implementations/altair.py b/plots/band-basic/implementations/altair.py index f1d84c02fb..aa8eadd4d3 100644 --- a/plots/band-basic/implementations/altair.py +++ b/plots/band-basic/implementations/altair.py @@ -1,6 +1,7 @@ -"""pyplots.ai +""" pyplots.ai band-basic: Basic Band Plot Library: altair 6.0.0 | Python 3.14 +Quality: 94/100 | Updated: 2026-02-23 """ import altair as alt diff --git a/plots/band-basic/metadata/altair.yaml b/plots/band-basic/metadata/altair.yaml index d8cf2fc3bd..23207d8adb 100644 --- a/plots/band-basic/metadata/altair.yaml +++ b/plots/band-basic/metadata/altair.yaml @@ -1,7 +1,7 @@ library: altair specification_id: band-basic created: '2025-12-23T09:10:02Z' -updated: '2026-02-23T14:11:19Z' +updated: '2026-02-23T14:27:15Z' generated_by: claude-opus-4-6 workflow_run: 20456385370 issue: 0 @@ -10,10 +10,11 @@ library_version: 6.0.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/band-basic/altair/plot.html -quality_score: 88 +quality_score: 94 impl_tags: dependencies: [] techniques: + - annotations - layer-composition - hover-tooltips - html-export @@ -25,34 +26,34 @@ impl_tags: - grid-styling review: strengths: - - Dual confidence bands (50% + 95% CI) creating layered visual depth — exceeds spec - requirements - - 'Excellent Altair idioms: declarative layer composition, selection/condition for - interactivity, y2 encoding' - - Clean monochromatic color palette with consistent Python Blue theme - - Growing uncertainty bands convey realistic time-series behavior - - Dual output (PNG + HTML) leverages Altair web-native strengths - - All font sizes explicitly configured for readability + - Cohesive monochromatic blue palette with three intentional tones creates visual + depth and professional polish + - Dual confidence bands (50% + 95% CI) exceed spec requirements and add analytical + value + - Growing uncertainty narrative is immediately apparent and reinforced by the red + annotation callout + - Interactive features (tooltips, hover guide) work in HTML export without polluting + static PNG output + - All text sizes explicitly set with appropriate hierarchy (28/22/18/16pt) weaknesses: - - Design sophistication limited by monochromatic-only approach — needs richer visual - treatment - - No visual emphasis or focal point to guide viewer attention to growing uncertainty - - Outer band edges quite faint at 0.2 opacity reducing visual clarity at extremes - - Data context is somewhat generic — a more specific scenario would improve realism - image_description: 'The plot displays a band chart titled "band-basic · altair · - pyplots.ai" with a dark navy central trend line showing a sinusoidal pattern combined - with linear growth (from ~0 at x=0 to ~4 at x=10). Two semi-transparent blue bands - surround the central line: an inner narrower band (50% CI) with medium blue opacity - and an outer wider band (95% CI) with lighter blue opacity. Both bands widen progressively - from left to right, demonstrating growing uncertainty over time. The x-axis is - labeled "Time (s)" ranging from 0.0 to 10.0, and the y-axis is labeled "Signal - Amplitude (mV)" ranging from approximately -3.0 to 10.0. The grid is very subtle - (low opacity), the view border is removed, and all text is clearly readable. The - color scheme is monochromatic blue throughout (#306998 for bands, #1a3a5c for - the line).' + - Axis line/tick styling remains at Altair defaults rather than being refined (DE-02) + - Interactive features (selection, tooltips) are invisible in the static PNG — only + benefit the HTML export (LM-02) + image_description: 'The plot displays a band chart with an oscilloscope signal theme + over a 0-10 second time range. A dark navy center line traces a sinusoidal wave + with upward linear drift (approximately 2*sin(x) + 0.5x), ranging from about -2.5 + mV to 6 mV. Two semi-transparent blue confidence bands surround it: a lighter + outer band (95% CI, teal-blue at 0.25 opacity) and a darker inner band (50% CI, + deeper blue at 0.3 opacity). Both bands visibly widen from left to right, illustrating + growing uncertainty over time. At x approximately 9.1 seconds, a red dashed vertical + rule spans the full 95% CI width, with bold red annotation text "95% CI: +/-3.7 + mV" offset to the right. The title reads "band-basic - altair - pyplots.ai" in + large font at the top. Axes are labeled "Time (s)" (x-axis) and "Oscilloscope + Signal (mV)" (y-axis). Grid lines are very subtle with light gray color. The view + border is removed. The layout fills the 4800x2700 canvas well with balanced margins.' criteria_checklist: visual_quality: - score: 29 + score: 30 max: 30 items: - id: VQ-01 @@ -60,65 +61,67 @@ review: score: 8 max: 8 passed: true - comment: 'All font sizes explicitly set: title=28pt, axis titles=22pt, tick - labels=18pt. All clearly readable.' + comment: 'All font sizes explicitly set: title 28pt, axis titles 22pt, tick + labels 18pt, annotation 16pt bold. All perfectly readable.' - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No overlapping text elements. Tick labels well-spaced on both axes. + comment: No overlapping text elements. Annotation positioned with dx=10 to + avoid collision. - id: VQ-03 name: Element Visibility - score: 5 + score: 6 max: 6 passed: true - comment: Central line and inner band clearly visible. Outer band edges are - quite faint at 0.2 opacity. + comment: Center line clearly visible against bands. Bands distinguishable + via different blue tones and opacity. Smooth monotone interpolation. - id: VQ-04 name: Color Accessibility score: 4 max: 4 passed: true - comment: Monochromatic blue scheme is inherently colorblind-safe with good - contrast. + comment: Monochromatic blue scheme is colorblind-safe. Red accent for annotation + only, good contrast. - id: VQ-05 name: Layout & Canvas score: 4 max: 4 passed: true - comment: Plot fills canvas well at 1600x900 (16:9). Balanced margins. + comment: 4800x2700 canvas well utilized with balanced margins. - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Time (s) and Signal Amplitude (mV) — descriptive with units. + comment: Time (s) and Oscilloscope Signal (mV) both descriptive with units. design_excellence: - score: 12 + score: 15 max: 20 items: - id: DE-01 name: Aesthetic Sophistication - score: 5 + score: 6 max: 8 - passed: false - comment: Cohesive monochromatic blue palette with dual CI bands. Above defaults - but fundamentally one color at different opacities. + passed: true + comment: Cohesive monochromatic blue palette with three intentional tones + creating visual depth. Red accent for annotation provides strong contrast. + Clearly above defaults. - id: DE-02 name: Visual Refinement score: 4 max: 6 passed: true - comment: View strokes removed, grid opacity at 0.2, monotone interpolation. - Good refinement. + comment: Subtle grid (0.15 opacity), view border removed. Axis line styling + remains at Altair defaults. - id: DE-03 name: Data Storytelling - score: 3 + score: 5 max: 6 - passed: false - comment: Widening uncertainty bands implicitly communicate growing uncertainty - but no explicit focal point or emphasis. + passed: true + comment: Widening band communicates growing uncertainty. Dual-band approach + adds depth. Red annotation creates focal point. spec_compliance: score: 15 max: 15 @@ -128,53 +131,52 @@ review: score: 5 max: 5 passed: true - comment: Correct band plot with filled region and central trend line. Exceeds - spec with dual-band CI. + comment: Correct band plot with filled region between boundary lines. - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: Semi-transparent fill, central line in contrasting color, smooth - monotone interpolation, 100 data points. + comment: Semi-transparent fill, contrasting center line, smooth interpolation. + Exceeds spec with inner 50% CI band. - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: X=time, Y=signal amplitude. Axes show full data range. + comment: X/Y correctly mapped, 100 data points within range, axes show full + data extent. - id: SC-04 name: Title & Legend score: 3 max: 3 passed: true - comment: Title in correct format. No legend needed for single-series band - plot. + comment: Title matches required format. No legend needed for single-series + band plot. data_quality: - score: 13 + score: 15 max: 15 items: - id: DQ-01 name: Feature Coverage - score: 5 + score: 6 max: 6 passed: true - comment: Shows widening CI, dual confidence bands, sinusoidal pattern with - linear growth. Covers band plot features well. + comment: Shows widening uncertainty, sinusoidal + linear trend, dual CI bands, + and annotated callout. - id: DQ-02 name: Realistic Context - score: 4 + score: 5 max: 5 passed: true - comment: Signal amplitude in mV is plausible scientific scenario. Somewhat - generic — more specific domain would strengthen it. + comment: Oscilloscope voltage measurement with sensor drift uncertainty. Neutral + scientific context. - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: Signal in millivolt range, time in seconds, uncertainty scaling factor - — all realistic. + comment: Millivolt range and 0-10s timespan realistic for oscilloscope measurements. code_quality: score: 10 max: 10 @@ -184,33 +186,33 @@ review: score: 3 max: 3 passed: true - comment: Clean Imports → Data → Plot layers → Combine → Save structure. + comment: 'Linear flow: imports, data, plot layers, combine, save. No functions + or classes.' - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: np.random.seed(42) set. Data is deterministic. + comment: Deterministic data generation with np.linspace and np.sin. - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: All three imports used. + comment: All three imports (altair, numpy, pandas) are used. - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Clean, well-organized. Interactive elements are legitimate Altair - features. + comment: Clean, well-structured. Interactive features are legitimate Altair + capabilities. - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves as plot.png with scale_factor=3.0 and plot.html. Current Altair - 6.x API. + comment: Saves plot.png with scale_factor=3.0. Uses current Altair 6.x API. library_mastery: score: 9 max: 10 @@ -220,13 +222,14 @@ review: score: 5 max: 5 passed: true - comment: Declarative layered composition, proper encoding types, mark_area - with y/y2, configure_axis/configure_view. + comment: 'Declarative grammar: mark_area, mark_line, mark_rule, mark_text, + mark_point. Proper encoding with type shorthand. Layer composition with + + operator.' - id: LM-02 name: Distinctive Features score: 4 max: 5 passed: true - comment: Uses selection_point, alt.condition, alt.Tooltip, y2 encoding, HTML - export. Interactive features invisible in PNG. - verdict: REJECTED + comment: alt.selection_point with nearest, alt.condition for conditional encoding, + rich tooltips, HTML export. Core visualization uses standard marks. + verdict: APPROVED