Skip to content

update(box-basic): seaborn — comprehensive quality review and improvement#4233

Merged
github-actions[bot] merged 6 commits intomainfrom
implementation/box-basic/seaborn
Feb 14, 2026
Merged

update(box-basic): seaborn — comprehensive quality review and improvement#4233
github-actions[bot] merged 6 commits intomainfrom
implementation/box-basic/seaborn

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

Updated seaborn implementation for box-basic.

Changes: Comprehensive quality review — improved data quality, visual design, code style, and library feature usage.

Test Plan

  • Preview images uploaded to GCS staging
  • Implementation file passes ruff format/check
  • Metadata YAML updated with current versions
  • Automated review triggered

Generated with Claude Code /update command

Copilot AI review requested due to automatic review settings February 14, 2026 22:10
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 14, 2026

AI Review - Attempt 1/3

Image Description

The plot displays five box-and-whisker plots arranged horizontally, one for each department: Engineering (dark blue), Marketing (golden/amber), Sales (green), HR (coral/orange), and Finance (purple). Each box shows the median as a horizontal black line, with the box spanning Q1 to Q3. Whiskers extend to approximately 1.5×IQR. Individual data points are overlaid as a semi-transparent strip plot (jittered) in matching colors, making outliers and the full distribution visible. The y-axis is labeled "Salary ($)" with formatted tick labels ($40K–$160K). The x-axis is labeled "Department". The title reads "box-basic · seaborn · pyplots.ai" in medium weight. Top and right spines are removed, and a subtle horizontal grid assists value reading. The layout is clean with good use of canvas space.

Quality Score: 82/100

Criteria Checklist

Visual Quality (26/30)

  • VQ-01: Text Legibility (8/8) - All font sizes explicitly set: title 24pt, labels 20pt, ticks 16pt. All text clearly readable.
  • VQ-02: No Overlap (6/6) - No overlapping text elements. Five categories fit comfortably on x-axis.
  • VQ-03: Element Visibility (5/6) - Boxes are well-sized (width=0.6). Strip plot points are slightly small (size=4) and could be a touch larger for better visibility, but alpha=0.35 is appropriate for the density.
  • VQ-04: Color Accessibility (3/4) - Five distinct hues with good separation. Green and orange could be slightly challenging in some color vision deficiencies, but overall acceptable differentiation.
  • VQ-05: Layout & Canvas (2/4) - Plot fills horizontal space well but there is notable empty space in the upper portion of the canvas ($120K-$170K region is sparsely populated). The vertical extent could be tighter.
  • VQ-06: Axis Labels & Title (2/2) - "Salary ($)" with formatted tick labels showing "$XK" units. "Department" is descriptive.

Design Excellence (12/20)

  • DE-01: Aesthetic Sophistication (6/8) - Custom 5-color palette starting with Python Blue, clean spine removal, formatted currency axis. Clearly above defaults — the strip plot overlay is a nice design touch. Not quite publication-perfect but strong.
  • DE-02: Visual Refinement (4/6) - Spines removed, subtle grid (alpha=0.2), good whitespace. Well-refined but not exceptional.
  • DE-03: Data Storytelling (2/6) - Data is clearly displayed but there are no annotations, callouts, or narrative emphasis. The viewer must find their own insights (e.g., Engineering has highest salaries, Sales has widest spread). No storytelling beyond the raw visualization.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct box plot type with all standard elements.
  • SC-02: Required Features (4/4) - Median line shown, outliers visible via strip plot, whiskers at 1.5×IQR (seaborn default), different colors per category.
  • SC-03: Data Mapping (3/3) - Categories on x-axis, values on y-axis, correctly mapped.
  • SC-04: Title & Legend (3/3) - Title follows exact format "box-basic · seaborn · pyplots.ai". No legend needed as categories are on x-axis.

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) - Shows different distribution widths (Sales wide, HR narrow), different medians, and outliers. Good variation. Could show a more dramatically skewed distribution for one category.
  • DQ-02: Realistic Context (5/5) - Salary distributions across departments is a classic, neutral, real-world scenario. Department names are realistic.
  • DQ-03: Appropriate Scale (4/4) - Salary ranges ($30K–$170K) are realistic for the departments shown. Engineering highest, HR lowest — plausible.

Code Quality (9/10)

  • CQ-01: KISS Structure (3/3) - Clean flat structure: imports → data → plot → style → save. No functions or classes.
  • CQ-02: Reproducibility (2/2) - np.random.seed(42) is set.
  • CQ-03: Clean Imports (2/2) - All four imports (plt, np, pd, sns) are used.
  • CQ-04: Code Elegance (1/2) - The loop with if/elif chain for setting per-category parameters is slightly verbose. A dictionary-based approach would be cleaner.
  • CQ-05: Output & API (1/1) - Saves as plot.png, uses correct seaborn 0.14+ API with hue parameter.

Library Mastery (6/10)

  • LM-01: Idiomatic Usage (4/5) - Uses seaborn's axes-level sns.boxplot() with DataFrame, hue parameter for modern API, and proper palette handling. Good but the strip plot overlay is a matplotlib-compatible technique, not uniquely seaborn.
  • LM-02: Distinctive Features (2/5) - The sns.stripplot overlay is a seaborn-specific feature that works seamlessly with sns.boxplot. However, beyond this combination, the implementation relies heavily on matplotlib for styling. Could leverage seaborn's set_context() or statistical features more.

Strengths

  • Excellent strip plot overlay on box plots showing individual data points — a seaborn-idiomatic pattern
  • Well-chosen realistic salary scenario with meaningful variation across departments
  • Clean, modern seaborn API usage (hue parameter, legend=False)
  • Professional formatting with currency-formatted y-axis labels
  • All text sizes explicitly set for the target resolution

Weaknesses

  • No data storytelling: could add annotations highlighting key insights (e.g., "Engineering: highest median", "Sales: widest spread", median salary lines or summary statistics)
  • Strip plot points are slightly small (size=4) — increasing to 5-6 would improve visibility
  • Notable empty space in upper canvas region; y-axis range extends well beyond data density
  • Per-category data generation uses verbose if/elif chain instead of a cleaner dictionary mapping
  • Could use more distinctive seaborn features (e.g., sns.set_context("talk") for global scaling, or sns.despine() instead of manual spine removal)

Verdict: REJECTED

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

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the seaborn implementation for the box-basic plot spec, aiming to improve visual styling and use additional seaborn features while refreshing the per-library metadata.

Changes:

  • Adjusts the seaborn box plot styling (palette, grid/spines) and overlays a strip plot.
  • Updates seaborn.yaml metadata fields (updated timestamp, generator, Python version) and resets quality_score.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
plots/box-basic/metadata/seaborn.yaml Updates seaborn implementation metadata (timestamps, generator, versions, quality score).
plots/box-basic/implementations/seaborn.py Refines seaborn visualization and formatting; adds stripplot overlay and styling tweaks.

Comment on lines +1 to +4
""" pyplots.ai
box-basic: Basic Box Plot
Library: seaborn 0.13.2 | Python 3.13.11
Quality: 93/100 | Created: 2025-12-23
Library: seaborn 0.13.2 | Python 3.14
Quality: 82/100 | Created: 2025-12-23
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation header has an invalid quality field (Quality: /100) and uses Updated: instead of the standard Quality: <score>/100 | Created: <YYYY-MM-DD> format. This repo’s impl-review workflow rewrites headers using that exact template, so the header should either keep the last known score or use a placeholder like pending, while still preserving the Created: field format.

Copilot uses AI. Check for mistakes.
palette=palette,
linewidth=2.5,
fliersize=10,
fliersize=0,
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fliersize=0 disables boxplot outlier markers. For box-basic, the spec explicitly calls for displaying outliers as individual points; the current stripplot shows all points but no longer distinguishes outliers from inliers. Consider re-enabling boxplot fliers (or plotting only the outliers as a separate layer) so outliers are clearly represented.

Suggested change
fliersize=0,

Copilot uses AI. Check for mistakes.
Comment on lines 3 to +5
created: '2025-12-23T00:35:01Z'
updated: '2025-12-23T00:37:04Z'
generated_by: claude-opus-4-5-20251101
updated: '2026-02-14T22:13:30Z'
generated_by: claude-opus-4-6
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated timestamp is in a different format than other metadata files (unquoted with +00:00 offset). Most metadata in this repo uses quoted ISO-8601 strings ending with Z (e.g., updated: '2025-12-23T00:38:05Z' in plots/box-basic/metadata/matplotlib.yaml). Aligning the format avoids YAML parsing it as a timestamp type and keeps metadata consistent.

Copilot uses AI. Check for mistakes.
Comment thread plots/box-basic/metadata/seaborn.yaml Outdated
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/box-basic/seaborn/plot_thumb.png
preview_html: null
quality_score: 93
quality_score: 82
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quality_score was changed from a numeric value to null, but the same file still contains a detailed review section with scores and an APPROVED verdict. Either keep quality_score consistent with that review (or regenerate/update the review data to match the new implementation) so consumers don’t see conflicting metadata.

Suggested change
quality_score: 82
quality_score: null

Copilot uses AI. Check for mistakes.
Attempt 1/3 - fixes based on AI review
@github-actions
Copy link
Copy Markdown
Contributor

🔧 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 Feb 14, 2026

AI Review - Attempt 2/3

Image Description

The plot displays 5 box-and-whisker plots comparing salary distributions across departments (Engineering, Marketing, Sales, HR, Finance). Each box has a distinct color: Engineering in deep blue (#306998), Marketing in golden orange (#E8A838), Sales in green (#4CAF50), HR in coral orange (#FF7043), and Finance in purple (#9C27B0). Individual data points are overlaid via strip plot with alpha transparency (0.4), showing the raw distribution alongside the box plot summaries. The y-axis shows salary in dollar format ($40K–$140K), the x-axis shows department names. Three annotation arrows highlight key insights: "Highest median: $93K" pointing to Engineering (blue text/arrow), "Right-skewed distribution" pointing to Sales (green text/arrow), and "Widest IQR: $22K spread" pointing near HR (purple text/arrow). Top and right spines are removed. A subtle y-axis grid (alpha 0.2) is present. Title reads "box-basic · seaborn · pyplots.ai" in medium weight at the top.

Quality Score: 94/100

Criteria Checklist

Visual Quality (28/30)

  • VQ-01: Text Legibility (8/8) — All font sizes explicitly set: title 24pt, axis labels 20pt, ticks 16pt, plus set_context("talk", font_scale=1.1). All text clearly readable.
  • VQ-02: No Overlap (6/6) — No overlapping text. Annotations positioned with arrows to avoid crowding.
  • VQ-03: Element Visibility (5/6) — Box widths and strip plot sizing appropriate. Minor deduction: fliersize=0 hides native outlier markers, though strip plot compensates.
  • VQ-04: Color Accessibility (3/4) — Good palette overall, but HR (coral orange #FF7043) and Marketing (golden orange #E8A838) are somewhat close for certain color-vision deficiencies.
  • VQ-05: Layout Balance (4/4) — 16×9 figure with tight_layout. Plot fills canvas well with balanced margins.
  • VQ-06: Axis Labels & Title (2/2) — "Salary ($)" with unit, "Department" is descriptive.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct box plot type.
  • SC-02: Required Features (4/4) — Median lines visible, outliers shown via strip plot, whiskers at 1.5×IQR (seaborn default), different colors per category.
  • SC-03: Data Mapping (3/3) — Categories on x-axis, numerical values on y-axis.
  • SC-04: Title Format (3/3) — Correct format "box-basic · seaborn · pyplots.ai". No legend needed since categories are on x-axis.

Design Excellence (17/20)

  • DE-01: Aesthetic Sophistication (7/8) — Custom palette starting with Python Blue, formatted dollar tick labels, set_context("talk"), despine. Publication-level polish clearly above defaults.
  • DE-02: Visual Refinement (5/6) — Spines removed, subtle grid, formatted ticks, strip plot overlay instead of native fliers. Strong refinement.
  • DE-03: Data Storytelling (5/6) — Three color-coded annotations with arrows highlighting highest median, widest IQR, and skewed distribution. Actively guides viewer to insights.

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Shows different distributions (normal + exponential for Sales), varying medians, different spreads, outliers visible through strip plot.
  • DQ-02: Realistic Context (5/5) — Salary distributions across departments — neutral, realistic business scenario.
  • DQ-03: Appropriate Scale (4/4) — Salary ranges $40K–$140K are realistic.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Clean Imports → Data → Plot → Save flow, no functions/classes.
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set.
  • CQ-03: Clean Imports (2/2) — All imports used.
  • CQ-04: Code Elegance (2/2) — Clean, well-structured, appropriate complexity.
  • CQ-05: Output & API (1/1) — Saves as plot.png, dpi=300.

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) — Proper axes-level API with hue/palette pattern (0.14+ compatible), set_context, despine.
  • LM-02: Distinctive Features (4/5) — sns.boxplot + sns.stripplot layering is a distinctive seaborn pattern. set_context and despine are seaborn-specific utilities.

Strengths

  • Excellent data storytelling with three targeted, color-coded annotations that guide the viewer to key insights
  • Strong seaborn idiom: boxplot + stripplot layering with proper hue/palette API compatibility
  • Diverse data generation — normal distributions plus exponential for Sales — showcasing distributional variety
  • Publication-quality formatting: dollar-formatted ticks, explicit font sizes, despine, subtle grid
  • Well-chosen realistic scenario with appropriate salary ranges

Weaknesses

  • Two orange-adjacent colors (Marketing #E8A838, HR #FF7043) are somewhat close for color-vision deficient viewers
  • Strip plot points slightly overlap in dense regions of Engineering and Sales boxes

Verdict: APPROVED

@github-actions github-actions Bot added quality:94 Quality score 94/100 ai-approved Quality OK, ready for merge labels Feb 14, 2026
Copilot AI review requested due to automatic review settings February 14, 2026 22:22
@MarkusNeusinger MarkusNeusinger review requested due to automatic review settings February 14, 2026 22:22
Copilot AI review requested due to automatic review settings February 14, 2026 22:22
@MarkusNeusinger MarkusNeusinger review requested due to automatic review settings February 14, 2026 22:22
Copilot AI review requested due to automatic review settings February 14, 2026 22:23
@MarkusNeusinger MarkusNeusinger review requested due to automatic review settings February 14, 2026 22:23
@github-actions github-actions Bot merged commit 060d224 into main Feb 14, 2026
3 checks passed
@github-actions github-actions Bot deleted the implementation/box-basic/seaborn branch February 14, 2026 22:23
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:82 Quality score 82/100 quality:94 Quality score 94/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants