Skip to content

feat(seaborn): implement scatter-marginal#6125

Merged
MarkusNeusinger merged 4 commits intomainfrom
implementation/scatter-marginal/seaborn
May 9, 2026
Merged

feat(seaborn): implement scatter-marginal#6125
MarkusNeusinger merged 4 commits intomainfrom
implementation/scatter-marginal/seaborn

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

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

Implementation: scatter-marginal - python/seaborn

Implements the python/seaborn version of scatter-marginal.

File: plots/scatter-marginal/implementations/python/seaborn.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): Scatter plot of Temperature (°C) vs Ice Cream Sales ($) on warm off-white background (#FAF8F1). Data points rendered in teal/green (Okabe-Ito #009E73) with white edges for definition, alpha=0.65 for density transparency. Title 'scatter-marginal · seaborn · anyplot.ai' clearly visible at top in dark text (font size 26pt). Marginal distributions on top and right axes display histograms with KDE curve overlays in matching teal/green color. Axis labels descriptive with units, tick labels on both axes clearly readable. Grid is subtle (dashed, alpha=0.3). All text is readable against the light background with good contrast.

Dark render (plot-dark.png): Same plot structure on dark near-black background (#1A1A17). All text adapted to light color and clearly readable against dark background—no dark-on-dark failures. Data colors (scatter points and marginal bars) are identical to light render, confirming theme-adaptive chrome only: background changed, data colors unchanged. Histograms, KDE curves, axis labels, and title all properly visible. Grid appears as light lines on dark background. Both renders demonstrate proper theme adaptation with no legibility issues.

Both renders pass theme-readability checks with excellent contrast and visibility.

Score: 86/100

Category Score Max
Visual Quality 30 30
Design Excellence 10 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 8 10
Library Mastery 9 10
Total 86 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) - All font sizes explicitly set; perfectly readable in both themes
  • VQ-02: No Overlap (6/6) - No overlapping text; clean layout
  • VQ-03: Element Visibility (6/6) - Scatter points and marginal distributions optimally sized
  • VQ-04: Color Accessibility (2/2) - CVD-safe Okabe-Ito palette; good contrast
  • VQ-05: Layout & Canvas (4/4) - Perfect proportions; plot fills 50-70% of canvas
  • VQ-06: Axis Labels & Title (2/2) - Descriptive with units
  • VQ-07: Palette Compliance (2/2) - Okabe-Ito green consistent in both renders; backgrounds theme-correct

Design Excellence (10/20)

  • DE-01: Aesthetic Sophistication (4/8) - Well-configured library defaults with brand colors; professional but not exceptional
  • DE-02: Visual Refinement (3/6) - Subtle grid styling; reasonable whitespace; some customization
  • DE-03: Data Storytelling (3/6) - Clear correlation and complementary distributions; data displayed effectively but no visual emphasis

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct scatter plot with marginal distributions
  • SC-02: Required Features (4/4) - All features present: scatter, histograms, KDE
  • SC-03: Data Mapping (3/3) - X/Y correctly mapped; axes show all data
  • SC-04: Title & Legend (3/3) - Correct format; no legend needed

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Shows all aspects: univariate + bivariate distributions
  • DQ-02: Realistic Context (5/5) - Real, neutral scenario
  • DQ-03: Appropriate Scale (4/4) - Realistic value ranges and proportions

Code Quality (8/10)

  • CQ-01: KISS Structure (3/3) - Simple linear flow
  • CQ-02: Reproducibility (2/2) - Seed set (np.random.seed(42))
  • CQ-03: Clean Imports (2/2) - Only necessary imports
  • CQ-04: Code Elegance (1/2) - Clean code but color specification uses #306998 instead of #009E73
  • CQ-05: Output & API (0/1) - Saves to 'plot.png' instead of 'plot-{THEME}.png'

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Expert use of sns.jointplot() for this exact use case
  • LM-02: Distinctive Features (4/5) - Marginal plot implementation is seaborn-specific

Score Caps Applied

  • None - No score caps triggered

Strengths

  • Excellent library mastery: sns.jointplot() is the perfect idiomatic choice
  • Perfect visual quality: all text readable in both themes with proper theme adaptation
  • Complete spec compliance: all required features present and correct
  • Clean, reproducible code with deterministic data generation
  • Effective use of transparency and white edges for marker definition

Weaknesses

  • CQ-05 CRITICAL: File output filename is 'plot.png' instead of 'plot-{THEME}.png'
  • CQ-04 CRITICAL: Color specification in code (#306998) doesn't match Okabe-Ito requirement (#009E73). Rendered images show correct color, indicating code/image mismatch
  • DE-01/DE-02: Limited aesthetic customization beyond library defaults
  • LM-02: Could leverage additional seaborn-specific styling features

Issues Found

  1. CQ-05 Output Naming: Saves to 'plot.png' — Should save to f'plot-{THEME}.png' to support theme-based rendering
    • Fix: Change to
  2. CQ-04 Color Specification: Code uses '#306998' (Python Blue) but brand standard is '#009E73' (Okabe-Ito green)
    • Fix: Update marginal_kws and joint_kws color to '#009E73' and verify theme-adaptive implementation

AI Feedback for Next Attempt

Fix the critical issues: (1) implement theme-adaptive rendering with proper environment variable handling to support plot-light.png and plot-dark.png outputs, (2) correct color specifications to use Okabe-Ito green (#009E73) throughout. Optionally enhance design excellence by refining grid styling and improving visual hierarchy.

Verdict: REJECTED

Score of 86/100 is below the 90/100 threshold for Attempt 1. Pending repair of critical code issues (file naming, color specification, theme handling).

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

github-actions Bot commented May 9, 2026

🔧 Repair Attempt 1/4

Applied fixes based on AI review feedback.

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


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 9, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): The plot displays a scatter plot with marginal distributions on a warm off-white background (#FAF8F1). The central scatter plot shows the relationship between Temperature (°C) on the x-axis and Ice Cream Sales ($) on the y-axis with 200 data points in a teal/green brand color (#009E73) at moderate alpha (0.65). The top and right marginal plots show histograms with overlaid KDE curves in the matching brand color with slightly higher alpha (0.7). The title "scatter-marginal · seaborn · anyplot.ai" is clearly visible in dark text at the top. Axis labels are readable and descriptive with units. Grid lines are subtle (alpha=0.3, dashed) and don't distract from the data. All text is clearly readable against the light background — no light-on-light failures.

Dark render (plot-dark.png): The same visualization rendered on a warm near-black background (#1A1A17). The title and all axis labels are in light/white text, providing excellent contrast. Critically, the data color remains identical to the light render (#009E73) — only the chrome (background, text, grid) has adapted to the dark theme. The tick labels and grid lines are subtle but clearly visible. All text is light-colored and readable against the dark background. The visual hierarchy and data representation are identical to the light render. No dark-on-dark failures detected — all chrome elements are correctly theme-adapted.

Score: 91/100

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

Visual Quality (29/30)

  • VQ-01: Text Legibility (7/8) - All text readable; font sizes adequate but could be slightly larger for 4800x2700px canvas
  • VQ-02: No Overlap (6/6) - No overlapping elements; all text fully readable
  • VQ-03: Element Visibility (6/6) - Markers and KDE curves perfectly adapted to data density with appropriate alpha
  • VQ-04: Color Accessibility (2/2) - Okabe-Ito color (#009E73) is colorblind-safe with good contrast in both themes
  • VQ-05: Layout & Canvas (4/4) - Perfect layout: plot fills appropriate canvas area, balanced margins
  • VQ-06: Axis Labels & Title (2/2) - Descriptive labels with units
  • VQ-07: Palette Compliance (2/2) - Brand color #009E73, theme-correct backgrounds, identical data colors across renders

Design Excellence (14/20)

  • DE-01: Aesthetic Sophistication (6/8) - Sophisticated use of jointplot with KDE marginals; above library defaults but fairly standard implementation
  • DE-02: Visual Refinement (4/6) - Good refinement: subtle grid, generous whitespace, KDE curves add polish
  • DE-03: Data Storytelling (4/6) - Good visual hierarchy: positive correlation clearly evident, marginals support the story

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct chart type with proper layout
  • SC-02: Required Features (4/4) - All features present: scatter + marginal histograms + KDE
  • SC-03: Data Mapping (3/3) - X/Y correctly assigned, all data visible
  • SC-04: Title & Legend (3/3) - Title format correct, no legend needed for single-series

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Shows all aspects of scatter-marginal plot type
  • DQ-02: Realistic Context (5/5) - Real, comprehensible, neutral scenario
  • DQ-03: Appropriate Scale (4/4) - Sensible values and proportions

Code Quality (9/10)

  • CQ-01: KISS Structure (3/3) - Simple, clean code
  • CQ-02: Reproducibility (2/2) - Uses np.random.seed(42)
  • CQ-03: Clean Imports (2/2) - Only necessary imports
  • CQ-04: Code Elegance (2/2) - No over-engineering or fake UI
  • CQ-05: Output & API (0/1) - Code saves as plot.png instead of plot-{THEME}.png; lacks ANYPLOT_THEME environment variable checking

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Expert use of seaborn's high-level jointplot API
  • LM-02: Distinctive Features (4/5) - Good use of seaborn-specific features; could explore more creative styling

Score Caps Applied

  • None

Strengths

  • Correct plot type with proper layout (scatter + marginal histograms + KDE curves)
  • Excellent visual quality: readable in both light and dark themes, no overlapping elements
  • Idiomatic use of seaborn's jointplot API with thoughtful customization (alpha, KDE, grid styling)
  • Strong data storytelling: correlated Temperature-IceCreamSales data clearly shows positive relationship
  • Perfect specification compliance: correct title format, proper data mapping, all required features present
  • Clean code structure with reproducible random seed

Weaknesses

  • CQ-05: Code saves to bare 'plot.png' instead of theme-specific 'plot-{THEME}.png'; no ANYPLOT_THEME environment variable checking in the code (output is correct via pipeline wrapper, but code itself needs theme-adaptive implementation)
  • VQ-01: Font sizes adequate but could be slightly larger for the large canvas for even better prominence
  • DE-01: Design is sophisticated but fairly standard seaborn jointplot styling — could use more intentional aesthetic choices (custom palette tweaks, unique visual hierarchy)

Issues Found

  1. CQ-05 MISSING: Code API non-compliance
    • Fix: Update savefig call to use f-string: f'plot-{os.getenv("ANYPLOT_THEME", "light")}.png'
    • Add theme-adaptive styling via sns.set_theme() with theme tokens from environment

AI Feedback for Next Attempt

Score 91/100 — APPROVED (Attempt 2). The implementation is visually excellent with perfect theme-adaptation in the output. The single issue is code-level: the source code doesn't properly implement the theme-adaptive API even though the pipeline wrapper produces correct output. For Attempt 3 (if needed), embed the ANYPLOT_THEME environment variable handling directly in the code and update the savefig call to use theme-specific filenames. This will make the code self-contained and audit-compliant.

Verdict: APPROVED

@github-actions github-actions Bot added quality:91 Quality score 91/100 ai-approved Quality OK, ready for merge and removed quality:86 Quality score 86/100 labels May 9, 2026
@MarkusNeusinger MarkusNeusinger merged commit b578025 into main May 9, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/scatter-marginal/seaborn branch May 9, 2026 05:30
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 quality:91 Quality score 91/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant