Skip to content

feat(altair): implement scatter-constellation-diagram#4970

Merged
github-actions[bot] merged 8 commits intomainfrom
implementation/scatter-constellation-diagram/altair
Mar 17, 2026
Merged

feat(altair): implement scatter-constellation-diagram#4970
github-actions[bot] merged 8 commits intomainfrom
implementation/scatter-constellation-diagram/altair

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: scatter-constellation-diagram - altair

Implements the altair version of scatter-constellation-diagram.

File: plots/scatter-constellation-diagram/implementations/altair.py

Parent Issue: #4562


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 17, 2026

AI Review - Attempt 1/3

Image Description

The plot shows a 16-QAM constellation diagram on a square canvas. Sixteen red cross markers indicate ideal constellation points arranged in a 4×4 grid at I/Q coordinates ±1 and ±3. Approximately 1000 semi-transparent blue dots represent received symbols, clustered around each ideal point with Gaussian noise spread. Dashed gray decision boundary lines are drawn at I/Q values of -4, -2, 0, 2, and 4, separating the 16 symbol regions. The title reads "scatter-constellation-diagram · altair · pyplots.ai" at the top. Axes are labeled "In-Phase (I)" (x) and "Quadrature (Q)" (y) with range approximately -5 to 5. An EVM annotation "EVM = 14.0%" appears in the upper-right area. The background is white with no grid lines. The overall layout is clean with a square aspect ratio preserving constellation geometry.

Score: 82/100

Category Score Max
Visual Quality 25 30
Design Excellence 11 20
Spec Compliance 15 15
Data Quality 14 15
Code Quality 10 10
Library Mastery 7 10
Total 82 100

Visual Quality (25/30)

  • VQ-01: Text Legibility (7/8) — Font sizes explicitly set (title=28, axis=22, ticks=18, EVM=20). All readable, but canvas is undersized so effective pixel sizes are slightly below optimal at output resolution.
  • VQ-02: No Overlap (6/6) — No overlapping text or elements anywhere.
  • VQ-03: Element Visibility (5/6) — Received symbols at size=40/opacity=0.35 are appropriate for 1000 points but slightly faint. Ideal crosses at size=350 are clearly visible.
  • VQ-04: Color Accessibility (3/4) — Blue (#306998) vs red (#D62728) is distinguishable for most colorblind types but not an optimized colorblind-safe pairing.
  • VQ-05: Layout & Canvas (2/4) — Canvas is 900×900 at scale_factor=3.0 = 2700×2700 px. Target for square plots is 3600×3600 (width=1200, height=1200). Undersized by 25%.
  • VQ-06: Axis Labels & Title (2/2) — "In-Phase (I)" and "Quadrature (Q)" are descriptive with standard notation.

Design Excellence (11/20)

  • DE-01: Aesthetic Sophistication (4/8) — Well-configured with custom colors (Python blue + red), appropriate marker differentiation, and clean layout. But still looks like a configured default rather than a publication-quality design.
  • DE-02: Visual Refinement (3/6) — Grid disabled and view stroke removed, which is good. However, axis spines are still fully visible, and no background color refinement or subtle design touches.
  • DE-03: Data Storytelling (4/6) — Good visual hierarchy: large red crosses for ideal points vs small transparent blue dots for received symbols creates clear focal structure. EVM annotation adds quantitative context. Decision boundaries provide structural context.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct I/Q constellation scatter diagram.
  • SC-02: Required Features (4/4) — All spec features present: 16-QAM ideal points as red crosses, received symbols as semi-transparent dots, dashed decision boundaries, equal aspect ratio, EVM annotation.
  • SC-03: Data Mapping (3/3) — I mapped to x-axis, Q mapped to y-axis, symmetric limits centered at origin.
  • SC-04: Title & Legend (3/3) — Title follows {spec-id} · {library} · pyplots.ai format. No legend needed for this plot type.

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) — Shows ideal points, noisy received symbols, decision boundaries, and EVM metric. Could additionally show color-coded symbols by nearest ideal point for richer feature demonstration.
  • DQ-02: Realistic Context (5/5) — 16-QAM digital modulation is a real telecommunications scenario. Neutral technical domain.
  • DQ-03: Appropriate Scale (4/4) — Standard 16-QAM grid at ±1, ±3. SNR=20 dB is realistic. 1000 symbols is appropriate sample size.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Linear flow: imports → data generation → plot layers → composition → save.
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set at the start.
  • CQ-03: Clean Imports (2/2) — All three imports (altair, numpy, pandas) are used.
  • CQ-04: Code Elegance (2/2) — Clean, well-organized. EVM calculation is correct and concise. No over-engineering.
  • CQ-05: Output & API (1/1) — Saves as plot.png and plot.html. Current API usage.

Library Mastery (7/10)

  • LM-01: Idiomatic Usage (4/5) — Good use of Altair's declarative grammar: layered composition with alt.layer(), proper encoding types (:Q), alt.Scale, alt.Title, configure_* methods. Could use alt.datum or selection parameters for more advanced patterns.
  • LM-02: Distinctive Features (3/5) — Uses .interactive() for zoom/pan, tooltips for hover info, HTML export alongside PNG, and mark_rule with x2/y2 for decision boundaries — features that leverage Altair's interactive/web-native strengths.

Score Caps Applied

  • None

Strengths

  • All specification features implemented correctly — ideal points, received symbols, decision boundaries, EVM annotation, equal aspect ratio
  • Good visual hierarchy between ideal constellation points (large red crosses) and received symbols (small transparent blue dots)
  • Clean, well-structured code with correct EVM calculation
  • Good use of Altair layer composition and interactive/web-native features (tooltips, zoom/pan, HTML export)

Weaknesses

  • Canvas undersized at 2700×2700 vs target 3600×3600 — use width=1200, height=1200
  • Design lacks polish: axis spines still visible, no background refinement, no subtle styling touches
  • Received symbol opacity (0.35) is slightly too low, making clusters appear washed out
  • Color pairing (blue/red) is functional but not an optimized colorblind-safe palette

Issues Found

  1. VQ-05 LOW: Canvas dimensions 900×900 produce 2700×2700 px output, below the 3600×3600 target
    • Fix: Change width=1200, height=1200 to achieve 3600×3600 at scale_factor=3.0
  2. DE-01 MEDIUM: Design is functional but not publication-quality
    • Fix: Consider a more refined color palette, add subtle background color, improve typography hierarchy
  3. DE-02 LOW: Minimal visual refinement beyond disabling grid
    • Fix: Remove or thin axis spines, add subtle domain-specific styling touches, consider a light background tint
  4. VQ-04 MINOR: Blue/red color pairing not optimally colorblind-safe
    • Fix: Use a more distinct pairing like navy/orange or adjust to a known accessible palette

AI Feedback for Next Attempt

Increase canvas to width=1200, height=1200 for proper 3600×3600 output. Improve design excellence: remove or minimize axis spines, add subtle background refinement, consider a more sophisticated color palette (e.g., navy dots with orange/gold ideal markers). Increase received symbol opacity slightly (0.4-0.45) for better visibility. These changes should push the score above 90.

Verdict: REJECTED

@github-actions github-actions Bot added quality:82 Quality score 82/100 ai-rejected Quality not OK, triggers update labels Mar 17, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/3

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 17, 2026

AI Review - Attempt 2/3

Image Description

The plot shows a 16-QAM constellation diagram on a square canvas. Sixteen ideal constellation points are displayed as orange/red cross markers at the standard ±1, ±3 grid positions. Approximately 1000 received symbols are shown as semi-transparent teal/green dots clustered around each ideal point. Dashed grey decision boundary lines are drawn at -4, -2, 0, 2, 4 on both axes, separating the 16 symbol regions. The title reads "scatter-constellation-diagram · altair · pyplots.ai" at the top. Axes are labeled "In-Phase (I)" (x) and "Quadrature (Q)" (y) with range -5 to 5. An "EVM = 14.0%" annotation appears in bold in the upper-right area. The background is white with no grid lines; the view border is removed for a clean appearance.

Score: 85/100

Category Score Max
Visual Quality 27 30
Design Excellence 13 20
Spec Compliance 15 15
Data Quality 14 15
Code Quality 10 10
Library Mastery 6 10
Total 85 100

Visual Quality (27/30)

  • VQ-01: Text Legibility (7/8) — All font sizes explicitly set (title 28, axis titles 22, tick labels 18, EVM 20). All clearly readable. Minor: title could be slightly larger for the canvas size.
  • VQ-02: No Overlap (6/6) — No text or element overlap anywhere.
  • VQ-03: Element Visibility (5/6) — Received symbols at size=40/opacity=0.35 appropriate for 1000 points. Ideal crosses at size=350 are prominent. Some peripheral dots are slightly sparse.
  • VQ-04: Color Accessibility (4/4) — Blue vs red/orange is colorblind-safe. Good contrast against white background.
  • VQ-05: Layout & Canvas (3/4) — Square aspect ratio is correct for constellation diagrams. However, 900×900 at scale_factor=3.0 produces 2700×2700 instead of the standard 3600×3600 (should use width=1200, height=1200).
  • VQ-06: Axis Labels & Title (2/2) — "In-Phase (I)" and "Quadrature (Q)" are correct domain-specific labels.

Design Excellence (13/20)

  • DE-01: Aesthetic Sophistication (5/8) — Thoughtful color choices (Python Blue for received, red for ideal, grey for boundaries). Clean look with removed view stroke and disabled grid. Above defaults but not publication-level polish.
  • DE-02: Visual Refinement (4/6) — View stroke removed, default grid disabled, decision boundaries serve as contextual grid. Clean whitespace. Good refinement.
  • DE-03: Data Storytelling (4/6) — Clear visual hierarchy: large crosses vs small semi-transparent dots immediately communicate ideal vs received. EVM annotation provides quantitative insight. The noise spread around each ideal point visually tells the signal quality story.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct I/Q scatter constellation diagram.
  • SC-02: Required Features (4/4) — All features present: 16-QAM scheme, ideal points as crosses, received symbols as semi-transparent dots, dashed decision boundaries, equal aspect ratio, EVM annotation.
  • SC-03: Data Mapping (3/3) — I mapped to x-axis, Q mapped to y-axis, symmetric limits centered at origin.
  • SC-04: Title & Legend (3/3) — Title follows exact format "scatter-constellation-diagram · altair · pyplots.ai". No legend needed for this plot type.

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) — All 16 constellation points shown with noise clusters. Noise spread is visible. Could benefit from showing varying SNR or phase offset to demonstrate more impairments.
  • DQ-02: Realistic Context (5/5) — 16-QAM constellation is a real wireless communications scenario. Values and setup are authentic.
  • DQ-03: Appropriate Scale (4/4) — Standard ±1, ±3 grid for 16-QAM, 20dB SNR is realistic, 1000 symbols is appropriate.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Clean linear flow: imports → data generation → plot layers → composition → save.
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set.
  • CQ-03: Clean Imports (2/2) — All imports (altair, numpy, pandas) are used.
  • CQ-04: Code Elegance (2/2) — Clean, well-structured. EVM calculation is correct and concise. No over-engineering.
  • CQ-05: Output & API (1/1) — Saves as plot.png and plot.html, current API.

Library Mastery (6/10)

  • LM-01: Idiomatic Usage (4/5) — Good use of Altair's layered composition with alt.layer(), proper encoding types (:Q), alt.Title, alt.Scale, configure_axis, configure_view. Idiomatic declarative approach.
  • LM-02: Distinctive Features (2/5) — Uses .interactive() for zoom/pan and tooltips, plus HTML export. However, these are fairly basic Altair features. Could leverage more distinctive capabilities like selections, conditional encoding, or parameter-driven interactivity.

Score Caps Applied

  • None

Strengths

  • Perfect spec compliance — all 8 required features implemented correctly
  • Clean code structure with correct EVM calculation and proper signal processing math
  • Good visual hierarchy between ideal constellation points and received symbols
  • Effective use of Altair's layer composition pattern

Weaknesses

  • Canvas dimensions 2700×2700 instead of standard 3600×3600 (width/height should be 1200, not 900)
  • Decision boundary lines are quite faint at opacity 0.45 — could be slightly more visible
  • Library mastery could be improved by leveraging more distinctive Altair features (selections, conditional encoding)
  • Design could be elevated with a more refined color palette or subtle background treatment

Issues Found

  1. VQ-05 MINOR: Canvas produces 2700×2700 instead of 3600×3600
    • Fix: Change width=1200, height=1200 to match standard square output
  2. LM-02 LOW: Generic Altair usage without distinctive features
    • Fix: Consider adding selection-based highlighting or conditional color encoding for symbol clusters
  3. DE-01 MODERATE: Good but not exceptional design polish
    • Fix: Consider a more refined color palette, subtle background tint, or typographic refinement

AI Feedback for Next Attempt

Increase canvas to width=1200, height=1200 for standard 3600×3600 output. Consider making decision boundaries slightly more visible (opacity 0.55). To push design excellence higher, explore a more refined color palette and consider using Altair-specific features like selection parameters for richer interactivity in the HTML version. The core implementation is solid — focus on polish and library mastery.

Verdict: REJECTED

@github-actions github-actions Bot added quality:85 Quality score 85/100 ai-rejected Quality not OK, triggers update labels Mar 17, 2026
@github-actions github-actions Bot added ai-attempt-2 Second repair attempt and removed ai-rejected Quality not OK, triggers update labels Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 2/3

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 17, 2026

AI Review - Attempt 3/3

Image Description

The plot displays a 16-QAM constellation diagram on a square canvas. Sixteen ideal constellation points are shown as orange/red cross markers arranged in a 4×4 grid at I/Q coordinates ±1 and ±3. Approximately 1000 received symbols appear as semi-transparent teal/mint-green dots clustered around each ideal point with Gaussian noise spread. Dashed grey decision boundary lines are drawn at I/Q values -4, -2, 0, 2, and 4 on both axes, separating the 16 symbol decision regions. The title "scatter-constellation-diagram · altair · pyplots.ai" appears at the top in moderate font. Axes are labeled "In-Phase (I)" (x) and "Quadrature (Q)" (y) with range approximately -5 to 5. A bold "EVM = 14.0%" annotation is positioned in the upper-right quadrant. The background is white with no default grid lines; the view border stroke is removed. The overall layout is clean and square, preserving constellation geometry.

Score: 83/100

Category Score Max
Visual Quality 25 30
Design Excellence 13 20
Spec Compliance 15 15
Data Quality 14 15
Code Quality 10 10
Library Mastery 6 10
Total 83 100

Visual Quality (25/30)

  • VQ-01: Text Legibility (7/8) — Font sizes explicitly set: title=28, axis titles=22, tick labels=18, EVM annotation=20. All clearly readable at output resolution.
  • VQ-02: No Overlap (6/6) — No text or element overlap anywhere in the plot.
  • VQ-03: Element Visibility (5/6) — Received symbols at size=40, opacity=0.35 are appropriate for 1000 points per scatter guidelines (300+: s=20-50, alpha=0.3-0.5). Ideal crosses at size=350, strokeWidth=3 are prominent and clearly distinguishable. Clusters are slightly faint at the periphery.
  • VQ-04: Color Accessibility (3/4) — Blue (#306998) vs red (#D62728) is distinguishable for most colorblind types (deuteranopia, protanopia) due to luminance difference. Not an optimally designed colorblind-safe pairing.
  • VQ-05: Layout & Canvas (2/4) — Canvas is 900×900 at scale_factor=3.0 = 2700×2700 px. Target for square plots is 3600×3600 (width=1200, height=1200). Still undersized by 25% despite being flagged in both prior reviews.
  • VQ-06: Axis Labels & Title (2/2) — "In-Phase (I)" and "Quadrature (Q)" are descriptive with standard domain notation.

Design Excellence (13/20)

  • DE-01: Aesthetic Sophistication (5/8) — Thoughtful color differentiation between received symbols (Python blue) and ideal points (red crosses). Clean layout with removed view stroke and disabled grid. Decision boundaries serve as contextual structure. Above configured defaults but not publication-level design.
  • DE-02: Visual Refinement (4/6) — View stroke removed, default grid disabled, decision boundary dashed lines provide subtle structural context. Clean whitespace. Good refinement beyond defaults.
  • DE-03: Data Storytelling (4/6) — Clear visual hierarchy: large prominent crosses for ideal points vs small semi-transparent dots for received symbols immediately communicates the signal quality narrative. EVM annotation provides quantitative insight. The noise spread visually conveys modulation quality.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct I/Q scatter constellation diagram for 16-QAM.
  • SC-02: Required Features (4/4) — All spec features present: 16-QAM ideal points as large cross markers, received symbols as semi-transparent dots, dashed decision boundary grid lines, equal aspect ratio, EVM annotation.
  • SC-03: Data Mapping (3/3) — I correctly mapped to x-axis, Q to y-axis, symmetric limits centered at origin.
  • SC-04: Title & Legend (3/3) — Title follows exact format "scatter-constellation-diagram · altair · pyplots.ai". No legend needed for this plot type.

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) — Shows all 16 ideal constellation points with noisy received symbol clusters, decision boundaries, and EVM metric. Could additionally demonstrate color-coded symbol-to-ideal mapping or varying noise levels to showcase more data features.
  • DQ-02: Realistic Context (5/5) — 16-QAM is a real digital modulation scheme used in Wi-Fi, 5G, and DVB. Neutral technical domain.
  • DQ-03: Appropriate Scale (4/4) — Standard ±1, ±3 grid for 16-QAM, 20 dB SNR is realistic, 1000 symbols is an appropriate sample size. EVM=14.0% is mathematically consistent with the SNR.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Clean linear flow: imports → data generation → plot layers → composition → save.
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set at the start.
  • CQ-03: Clean Imports (2/2) — All three imports (altair, numpy, pandas) are used.
  • CQ-04: Code Elegance (2/2) — Clean, well-structured. EVM calculation is correct with proper signal processing math. No over-engineering.
  • CQ-05: Output & API (1/1) — Saves as plot.png and plot.html. Current API usage.

Library Mastery (6/10)

  • LM-01: Idiomatic Usage (4/5) — Good use of Altair's declarative grammar: layered composition with alt.layer(), proper encoding types (:Q), alt.Scale for domain control, alt.Title, configure_axis, configure_view. Idiomatic declarative approach.
  • LM-02: Distinctive Features (2/5) — Uses .interactive() for zoom/pan, tooltips for hover info, HTML export, and mark_rule with x2/y2 for decision boundaries. These are relatively basic Altair features. Does not leverage more distinctive capabilities like selection parameters, conditional encoding, or alt.datum expressions.

Score Caps Applied

  • None

Strengths

  • Perfect spec compliance with all 8 required features correctly implemented (16-QAM, ideal crosses, received dots, decision boundaries, equal aspect, EVM, axis labels, title format)
  • Mathematically correct EVM calculation consistent with the 20 dB SNR setting
  • Excellent visual hierarchy between ideal constellation points and received symbols through size, opacity, and shape differentiation
  • Clean, well-structured code following KISS principles with proper reproducibility

Weaknesses

  • Canvas dimensions still 900×900 (2700×2700 output) instead of target 1200×1200 (3600×3600) — unfixed across all 3 attempts
  • Library mastery limited to basic Altair features; no use of selections, conditional encoding, or parameter-driven interactivity
  • Color pairing functional but not optimally colorblind-safe
  • Design is clean but not publication-quality — lacks subtle refinements that would elevate it

Issues Found

  1. VQ-05 PERSISTENT: Canvas 900×900 produces 2700×2700 instead of 3600×3600
    • Fix: Change width=1200, height=1200
  2. LM-02 LOW: Generic Altair usage without distinctive features
    • Fix: Add selection-based highlighting or conditional color encoding
  3. DE-01 MODERATE: Good but not exceptional aesthetic polish
    • Fix: More refined color palette, subtle background treatment, typographic hierarchy

AI Feedback for Next Attempt

The core implementation is solid with perfect spec compliance and clean code. The persistent canvas sizing issue (900×900 vs 1200×1200) should be fixed. To push design excellence higher, consider a more refined color palette and explore distinctive Altair features like selection parameters or conditional encoding for the HTML version.

Verdict: REJECTED

@github-actions github-actions Bot added quality:83 Quality score 83/100 ai-rejected Quality not OK, triggers update labels Mar 17, 2026
@github-actions github-actions Bot added ai-attempt-3 Third/final repair attempt and removed ai-rejected Quality not OK, triggers update labels Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 3/3

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 17, 2026

AI Review - Attempt 3/3

Image Description

The plot displays a 16-QAM constellation diagram on a near-square canvas (1020×1100). Sixteen ideal constellation points appear as red/salmon cross markers (#E45756) arranged in a 4×4 grid at I/Q coordinates ±1 and ±3. Approximately 1000 received symbols are shown as semi-transparent circles color-encoded by error magnitude using the viridis colormap — dark purple clusters near ideal points (low error) transitioning to teal/green and yellow for higher-error outliers. Dashed gray decision boundary lines are drawn at I/Q values -4, -2, 0, 2, 4 on both axes. The title "scatter-constellation-diagram · altair · pyplots.ai" is displayed at top center in 28pt font. Axes are labeled "In-Phase (I)" (x) and "Quadrature (Q)" (y) with tick labels at 18pt. A bold monospace "EVM = 14.0%" annotation sits in the upper-right quadrant. A viridis color legend labeled "Error Mag." appears on the right side. The background is white with no default grid; view border stroke is removed. The overall layout is clean and approximately square with the constellation geometry well-preserved.

Score: 87/100

Category Score Max
Visual Quality 27 30
Design Excellence 13 20
Spec Compliance 15 15
Data Quality 14 15
Code Quality 10 10
Library Mastery 8 10
Total 87 100

Visual Quality (27/30)

  • VQ-01: Text Legibility (7/8) — Font sizes explicitly set: title=28, axis titles=22, tick labels=18, EVM annotation=22, legend title=16, legend labels=14. All readable at output resolution. Legend labels at 14pt are slightly small.
  • VQ-02: No Overlap (6/6) — No text or element overlap anywhere in the plot.
  • VQ-03: Element Visibility (5/6) — Received symbols at size=45, default opacity=0.3 are appropriate for 1000 points per scatter guidelines (300+: s=20-50, alpha=0.3-0.5). Ideal crosses at size=400, strokeWidth=3.5 are prominent. Some peripheral scattered points are faint at base opacity.
  • VQ-04: Color Accessibility (4/4) — Viridis colormap is perceptually uniform and colorblind-safe. Red crosses (#E45756) provide strong luminance contrast against viridis palette.
  • VQ-05: Layout & Canvas (3/4) — Canvas 1020×1100 at scale_factor=3.0 = 3060×3300 px. Improved from prior 2700×2700 but still below 3600×3600 target. Width/height mismatch (1020≠1100) means aspect ratio is not perfectly square.
  • VQ-06: Axis Labels & Title (2/2) — "In-Phase (I)" and "Quadrature (Q)" are descriptive with standard domain notation.

Design Excellence (13/20)

  • DE-01: Aesthetic Sophistication (5/8) — Viridis color encoding for error magnitude is a meaningful, thoughtful design choice that adds an informative dimension. Red crosses contrast well against the viridis palette. Monospace font for EVM annotation adds professional touch. Clearly above configured defaults but not publication-level design.
  • DE-02: Visual Refinement (4/6) — Grid disabled, view stroke removed, custom domain/tick colors (#666666, #888888), dashed decision boundaries provide subtle structural context. Good refinement beyond defaults.
  • DE-03: Data Storytelling (4/6) — Error magnitude color encoding creates clear visual hierarchy: dark purple clusters near centers (low error) vs yellow-green outliers (high error). EVM annotation quantifies the modulation quality narrative. Viewer immediately understands signal integrity.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct I/Q scatter constellation diagram for 16-QAM.
  • SC-02: Required Features (4/4) — All spec features present: 16 ideal points as large red cross markers, received symbols as smaller semi-transparent dots, dashed decision boundary grid lines, approximately equal aspect ratio, EVM annotation ("EVM = 14.0%"), axis labels.
  • SC-03: Data Mapping (3/3) — I correctly mapped to x-axis, Q to y-axis, symmetric limits centered at origin (-5.5 to 5.5).
  • SC-04: Title & Legend (3/3) — Title follows exact format "scatter-constellation-diagram · altair · pyplots.ai". Legend shows "Error Mag." which is appropriate for the color encoding.

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) — Shows all 16 ideal constellation points, noisy received symbol clusters, error magnitude variation via viridis color encoding, decision boundaries, and EVM metric. Color dimension adds analytical depth. Could additionally demonstrate phase offset or varying noise conditions.
  • DQ-02: Realistic Context (5/5) — 16-QAM is a real digital modulation scheme used in Wi-Fi, 5G NR, and DVB. Neutral technical domain.
  • DQ-03: Appropriate Scale (4/4) — Standard ±1, ±3 grid for 16-QAM, 20 dB SNR is realistic, 1000 symbols is appropriate. EVM=14.0% is mathematically consistent with the SNR parameters.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Clean linear flow: imports → seed → data generation → dataframes → plot layers → composition → save.
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set at the start.
  • CQ-03: Clean Imports (2/2) — All three imports (altair, numpy, pandas) are used.
  • CQ-04: Code Elegance (2/2) — Clean, well-structured. Proper EVM calculation with correct signal processing math. Error magnitude computed per-symbol for color encoding.
  • CQ-05: Output & API (1/1) — Saves as plot.png and plot.html. Current Altair 6.0 API.

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (4/5) — Good use of Altair's declarative grammar: alt.layer() composition, proper encoding types (:Q, :N), alt.Scale/alt.Legend/alt.Title configurations, configure_axis/configure_view. Idiomatic declarative approach.
  • LM-02: Distinctive Features (4/5) — Uses alt.selection_point for nearest-point interactive highlighting, alt.condition for dynamic opacity and size encoding, rich formatted tooltips with alt.Tooltip, mark_rule with x2/y2 for decision boundary segments, HTML export alongside PNG. These are distinctive Altair features that meaningfully leverage the library's interactive capabilities.

Score Caps Applied

  • None

Strengths

  • Perfect spec compliance with all required features correctly implemented (16-QAM, ideal crosses, received dots, decision boundaries, EVM, axis labels, title format)
  • Viridis color encoding of error magnitude adds a meaningful analytical dimension beyond spec requirements
  • Interactive features (selection highlighting, conditional encoding, tooltips) showcase Altair's distinctive capabilities
  • Mathematically correct EVM calculation consistent with 20 dB SNR
  • Clean, well-structured code following KISS principles

Weaknesses

  • Canvas dimensions 1020×1100 (3060×3300 output) still below 3600×3600 target, and width≠height breaks perfect square aspect ratio
  • Legend label font size at 14pt is slightly small relative to other text elements
  • Design is clean and thoughtful but not quite at publication-quality level for 90+ scoring

Issues Found

  1. VQ-05 MINOR: Canvas 1020×1100 produces 3060×3300 instead of target 3600×3600, and is not perfectly square
    • Fix: Change to width=1200, height=1200 for 3600×3600 output
  2. VQ-01 MINOR: Legend label font at 14pt is slightly small
    • Fix: Increase to 16pt via labelFontSize=16 in legend config
  3. DE-01 MODERATE: Good design with viridis encoding but not publication-level sophistication
    • Fix: More refined typography, subtle background treatment, or additional design polish

AI Feedback for Next Attempt

Strong implementation with meaningful improvements from prior attempts. The viridis error magnitude encoding and selection-based interactivity are excellent additions that showcase Altair's strengths. The persistent canvas sizing issue (1020×1100 vs 1200×1200) is the main remaining gap. Overall a solid implementation at 87/100.

Verdict: APPROVED

@github-actions github-actions Bot added quality:87 Quality score 87/100 ai-approved Quality OK, ready for merge labels Mar 17, 2026
@github-actions github-actions Bot merged commit 9af2f0a into main Mar 17, 2026
3 checks passed
@github-actions github-actions Bot deleted the implementation/scatter-constellation-diagram/altair branch March 17, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt ai-attempt-2 Second repair attempt ai-attempt-3 Third/final repair attempt quality:82 Quality score 82/100 quality:83 Quality score 83/100 quality:85 Quality score 85/100 quality:87 Quality score 87/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants