Skip to content

feat(seaborn): implement scatter-basic#5319

Merged
github-actions[bot] merged 4 commits intomainfrom
implementation/scatter-basic/seaborn
Apr 23, 2026
Merged

feat(seaborn): implement scatter-basic#5319
github-actions[bot] merged 4 commits intomainfrom
implementation/scatter-basic/seaborn

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: scatter-basic - python/seaborn

Implements the python/seaborn version of scatter-basic.

File: plots/scatter-basic/implementations/python/seaborn.py

Parent Issue: #611


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 23, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): The plot is displayed on a warm off-white #FAF8F1 background. It shows a scatter of ~220 teal-green points (#009E73) plotting Marketing Spend ($ thousands) on the x-axis against Quarterly Revenue ($ thousands) on the y-axis, with a clear positive correlation. The title "scatter-basic · seaborn · anyplot.ai" appears in medium-weight dark text at the top. Both axis labels include units and are clearly readable. Tick labels in muted dark gray are visible on both axes. A very subtle grid overlays both axes. Top and right spines are removed (L-shaped frame). All text is clearly readable against the light background — no legibility issues.

Dark render (plot-dark.png): The same scatter plot appears on a near-black #1A1A17 background. The teal-green data points (#009E73) are identical in color to the light render — only chrome has flipped. The title, axis labels, and tick labels are rendered in light text and are clearly readable against the dark background. The subtle grid is visible. No dark-on-dark failures detected — text and axes are appropriately light. Both renders pass legibility checks.

Both paragraphs are required. A review that only describes one render is invalid.

Score: 85/100

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

Visual Quality (29/30)

  • VQ-01: Text Legibility (8/8) — Title 24pt, labels 20pt, ticks 16pt all explicitly set; both renders fully legible
  • VQ-02: No Overlap (6/6) — No text collisions; well-spaced axes and title
  • VQ-03: Element Visibility (5/6) — s=130 for 220 points is slightly above the recommended s=50–100 range, causing moderate overlap in dense lower-left region; edgecolor mitigates this but sizing could be tighter
  • VQ-04: Color Accessibility (2/2) — Single Okabe-Ito color with alpha=0.7; CVD-safe, no red-green issue
  • VQ-05: Layout & Canvas (4/4) — Plot fills the 16:9 canvas well; tight_layout + bbox_inches='tight' avoids waste
  • VQ-06: Axis Labels & Title (2/2) — Descriptive labels with units; title matches required {spec-id} · {library} · anyplot.ai format
  • VQ-07: Palette Compliance (2/2) — First (only) series is #009E73; backgrounds are #FAF8F1 (light) / #1A1A17 (dark); chrome uses adaptive INK/INK_SOFT tokens correctly in both renders

Design Excellence (10/20)

  • DE-01: Aesthetic Sophistication (4/8) — Well-configured defaults: brand green, adaptive theme, clean font. Solid but generic — a single-color scatter with no design differentiation beyond theme compliance. Not exceptional.
  • DE-02: Visual Refinement (4/6) — Good refinements: sns.despine removes top/right spines; grid at alpha=0.10 (very subtle); tick length=0 removes tick marks; edgecolor=PAGE_BG adds definition; axes.axisbelow=True. Not quite "every detail polished."
  • DE-03: Data Storytelling (2/6) — Data is displayed correctly but not interpreted. No visual hierarchy, no trend line, no emphasis on the positive correlation that is the point of the scatter. Viewer must find the story themselves.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct scatter plot via sns.scatterplot
  • SC-02: Required Features (4/4) — alpha=0.7, grid lines, axis labels, descriptive title, point size all present
  • SC-03: Data Mapping (3/3) — X/Y correctly assigned; all data within canvas; positive correlation visible
  • SC-04: Title & Legend (3/3) — Title matches required format; single-series needs no legend (correct omission)

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Gamma-distributed marketing spend creates realistic heteroscedasticity; 220 points show full range of scatter patterns; noise added for realistic variability
  • DQ-02: Realistic Context (5/5) — Marketing Spend vs. Quarterly Revenue is a neutral, real-world business scenario
  • DQ-03: Appropriate Scale (4/4) — Marketing spend $3–72K, revenue $5–310K — plausible B2B business values

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Linear flow: imports → tokens → data → plot → style → save; no functions or classes
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set
  • CQ-03: Clean Imports (2/2) — All imports (os, matplotlib, numpy, pandas, seaborn) are used
  • CQ-04: Code Elegance (2/2) — Clean, Pythonic; appropriate complexity for the task
  • CQ-05: Output & API (1/1) — Saves as plot-{THEME}.png; uses current seaborn 0.13+ API (sns.set_theme, sns.despine)

Library Mastery (6/10)

  • LM-01: Idiomatic Usage (4/5) — Uses sns.set_theme with context="talk", axes-level sns.scatterplot, sns.despine — idiomatic seaborn pattern
  • LM-02: Distinctive Features (2/5) — sns.despine and sns.set_theme context system are seaborn-distinctive, but the core visualization is a bare scatter that could be replicated in matplotlib with minor syntax changes. Seaborn's statistical regression layer (e.g., sns.regplot, confidence bands) is unused.

Score Caps Applied

  • None — DE-01=4 and DE-02=4; both exceed the ≤2 cap threshold. No other caps triggered.

Strengths

  • Perfect spec compliance and data quality — the marketing spend vs. revenue scenario is well-chosen with a realistic right-skewed distribution and natural noise
  • Excellent code quality and theme adaptation — all chrome tokens are correctly wired through sns.set_theme rc params; both renders pass legibility checks
  • Good visual refinements: despine, tick-length=0, edgecolor=PAGE_BG for marker definition, subtle grid

Weaknesses

  • DE-03 (2/6): No visual storytelling — the positive correlation is the insight but nothing in the plot guides the viewer toward it. A regression/trend line or correlation annotation would make the story immediately legible.
  • DE-01 (4/8): Single-color scatter with no secondary encoding is the minimal viable design. Adding a regression line, marginal distributions, or size variation would push this beyond configured-defaults territory.
  • LM-02 (2/5): Seaborn's most distinctive feature for scatter plots is built-in statistical visualization (sns.regplot adds a trend line + CI band in one call; sns.jointplot adds marginal distributions). Neither is used.
  • VQ-03 (5/6): Marker size s=130 is above the recommended s=50–100 for 220 points — reducing to ~90 with alpha=0.65 would reduce clutter in the dense region.

Issues Found

  1. DE-03 LOW + LM-02 LOW: No trend line or statistical overlay — the whole point of a basic scatter is to reveal correlation, yet nothing emphasizes it.
    • Fix: Replace sns.scatterplot with sns.regplot (adds a trend line + confidence band natively), or overlay a separate regression line. This simultaneously lifts DE-03 and LM-02.
  2. DE-01 MODERATE: Generic single-color scatter with no design differentiation beyond compliance.
    • Fix: After adding the regression line, add a compact Pearson r annotation (ax.text) and consider a subtle size variation on markers (ax.scatter with s proportional to a jitter variable, or just tighten size to reduce overlap density).
  3. VQ-03 MINOR: s=130 slightly large for 220 points.
    • Fix: Reduce to s=90, alpha=0.65 to tighten the dense cluster.

AI Feedback for Next Attempt

The implementation is technically solid — correct colors, adaptive themes, clean code, perfect spec compliance. The gap to 90+ is entirely in design and storytelling. Priority fix: use sns.regplot instead of sns.scatterplot to add a trend line with confidence band (this is seaborn's signature scatter feature and immediately makes the correlation story visible). Add a small ax.text annotation with the Pearson r value. Reduce marker size from s=130 to ~90 with alpha=0.65 for the 220-point density. These three changes address DE-03, LM-02, and VQ-03 simultaneously.

Verdict: REJECTED

@github-actions github-actions Bot added quality:85 Quality score 85/100 ai-approved Quality OK, ready for merge labels Apr 23, 2026
@github-actions github-actions Bot merged commit 280f1fd into main Apr 23, 2026
3 checks passed
@github-actions github-actions Bot deleted the implementation/scatter-basic/seaborn branch April 23, 2026 21:36
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:85 Quality score 85/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants