Skip to content

feat(altair): implement scatter-marginal#6128

Merged
MarkusNeusinger merged 3 commits intomainfrom
implementation/scatter-marginal/altair
May 9, 2026
Merged

feat(altair): implement scatter-marginal#6128
MarkusNeusinger merged 3 commits intomainfrom
implementation/scatter-marginal/altair

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 9, 2026

Implementation: scatter-marginal - python/altair

Implements the python/altair version of scatter-marginal.

File: plots/scatter-marginal/implementations/python/altair.py

Parent Issue: #2005


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 9, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): A composite scatter-marginal visualization on a warm off-white background (#FAF8F1). The main scatter plot in the lower-left displays 150 points in Okabe-Ito brand green (#009E73) with 0.65 opacity, showing a clear positive correlation. The top histogram aligned with the X-axis and right histogram aligned with the Y-axis both use the same green with 0.5 opacity, revealing roughly normal marginal distributions. Title 'scatter-marginal · altair · anyplot.ai' is in dark text (28px), clearly readable. Axis labels 'X Value (units)' and 'Y Value (units)' are in dark secondary text (20px), and tick labels (16px) are all legible against the light background. Grid lines are subtle (10% opacity) in light gray. All elements are properly spaced with no overlaps. The data colors are precisely #009E73 throughout the scatter and histograms. All text is readable — no light-on-light contrast issues.

Dark render (plot-dark.png): Identical composite layout on a warm near-black background (#1A1A17). All data elements remain #009E73 (identical to light render, confirming theme-invariant data coloring). The title, axis labels, and tick labels are now rendered in light text (INK and INK_SOFT tokens), clearly visible against the dark background. Grid lines appear in light gray with the same 10% opacity. Marginal histograms have subtle dark chrome (background), making them distinct from the plot background. No dark-on-dark text issues — all chrome elements (labels, ticks, grid) are light-colored as expected. Brand green (#009E73) remains vibrant and readable. Both renders pass the legibility check: the plot is equally readable in light and dark themes.

Score: 94/100

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

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) - All font sizes explicitly set (title 28px, labels 20px, ticks 16px); perfect readability in both themes
  • VQ-02: No Overlap (6/6) - No overlapping elements; marginals properly spaced and aligned
  • VQ-03: Element Visibility (6/6) - Markers (size=120, opacity=0.65) well-scaled for 150 points; histograms clearly distinct
  • VQ-04: Color Accessibility (2/2) - CVD-safe Okabe-Ito #009E73; good contrast throughout
  • VQ-05: Layout & Canvas (4/4) - Composite layout fills canvas well (1000×120 top, 1000×600 main, 120×600 right); balanced margins
  • VQ-06: Axis Labels & Title (2/2) - Descriptive labels with units; spec-compliant title
  • VQ-07: Palette Compliance (2/2) - Perfect: first series #009E73; backgrounds #FAF8F1 (light) / #1A1A17 (dark); theme tokens (INK, INK_SOFT) correctly applied in both renders

Design Excellence (15/20)

  • DE-01: Aesthetic Sophistication (5/8) - Thoughtfully executed composite design; professional appearance; intentional theme support; well-organized code
  • DE-02: Visual Refinement (5/6) - Subtle grid (10% opacity); clean spines; generous spacing; marginal plots appropriately simplified
  • DE-03: Data Storytelling (5/6) - Composite layout effectively communicates bivariate relationship + individual distributions; clear visual hierarchy with scatter as focal point; data choice demonstrates the plot type well

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct scatter-marginal: scatter in lower-left with aligned histograms on top and right
  • SC-02: Required Features (4/4) - All spec requirements present: main scatter, top marginal histogram, right marginal histogram, proper axis alignment, appropriate transparency
  • SC-03: Data Mapping (3/3) - X/Y correctly assigned; axes show all data with appropriate domains
  • SC-04: Title & Legend (3/3) - Title format correct; axis labels descriptive with units

Data Quality (14/15)

  • DQ-01: Feature Coverage (6/6) - Shows all aspects: bivariate correlation, marginal distributions (both roughly normal), density patterns; 150 points ideal for demonstration
  • DQ-02: Realistic Context (4/5) - Plausible synthetic data (y = 0.7×x + noise); sensible domain values; neutral context
  • DQ-03: Appropriate Scale (4/4) - Proportions correct; relationship realistic; no nonsensical values

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Clean linear flow: imports → seed → data → charts → save; no functions/classes
  • CQ-02: Reproducibility (2/2) - set; deterministic
  • CQ-03: Clean Imports (2/2) - All imports used (os, sys, Path, altair, numpy, pandas)
  • CQ-04: Code Elegance (2/2) - Pythonic, appropriate complexity; no fake functionality
  • CQ-05: Output & API (1/1) - Correct output format (plot-{THEME}.png + .html); current API

Library Mastery (10/10)

  • LM-01: Idiomatic Usage (5/5) - Expert use of Altair API: mark_circle(), mark_bar(), vconcat()/hconcat(), scale domains, configuration methods
  • LM-02: Distinctive Features (5/5) - Excellent use of Altair's composable plots, encoding-driven styling, shared scale domains for proper alignment

Score Caps Applied

  • None — all criteria passed without triggering caps

Strengths

  • Perfect visual quality: readable text, no overlap, excellent visibility in both light and dark themes
  • Precise theme compliance: backgrounds correct, all chrome tokens applied correctly, data colors theme-invariant
  • Expert Altair usage: idiomatic composition with vconcat()/hconcat(), scale sharing, configuration methods
  • Excellent spec compliance: all marginal features present, proper alignment, correct transparency
  • Clean code: simple structure, deterministic, all imports used, Pythonic style
  • Strong data storytelling: composite design effectively communicates both relationship and distributions

Weaknesses

  • None — implementation is strong across all dimensions

Issues Found

  • None — implementation passes all quality criteria

AI Feedback for Next Attempt

N/A — Ready for merge. This is a well-executed, publication-ready implementation that demonstrates excellent understanding of both the Altair library and the scatter-marginal visualization type.

Verdict: APPROVED

@github-actions github-actions Bot added quality:94 Quality score 94/100 ai-approved Quality OK, ready for merge labels May 9, 2026
@MarkusNeusinger MarkusNeusinger merged commit 5685fde into main May 9, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/scatter-marginal/altair branch May 9, 2026 05:29
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 quality:94 Quality score 94/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant