From 6711df12aa38b160701af72cd91f7b6b1b291f73 Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Sun, 15 Feb 2026 22:27:54 +0100 Subject: [PATCH 1/6] =?UTF-8?q?update(heatmap-basic):=20plotly=20=E2=80=94?= =?UTF-8?q?=20comprehensive=20quality=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comprehensive quality review: fix weaknesses from prior reviews, preserve strengths, improve quality across all dimensions. --- plots/heatmap-basic/implementations/plotly.py | 63 ++++++++++++------- plots/heatmap-basic/metadata/plotly.yaml | 10 +-- plots/heatmap-basic/specification.md | 2 +- plots/heatmap-basic/specification.yaml | 3 +- 4 files changed, 47 insertions(+), 31 deletions(-) diff --git a/plots/heatmap-basic/implementations/plotly.py b/plots/heatmap-basic/implementations/plotly.py index fb6b3365bd..a430c48373 100644 --- a/plots/heatmap-basic/implementations/plotly.py +++ b/plots/heatmap-basic/implementations/plotly.py @@ -1,7 +1,7 @@ -""" pyplots.ai +"""pyplots.ai heatmap-basic: Basic Heatmap -Library: plotly 6.5.0 | Python 3.13.11 -Quality: 92/100 | Created: 2025-12-23 +Library: plotly 6.5.2 | Python 3.14.3 +Quality: /100 | Updated: 2026-02-15 """ import numpy as np @@ -11,17 +11,23 @@ # Data np.random.seed(42) -# Create sample data: monthly sales across different product categories months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] -categories = ["Electronics", "Clothing", "Food", "Books", "Sports", "Home", "Beauty", "Toys"] +categories = ["Electronics", "Clothing", "Food & Beverage", "Books", "Sports", "Home & Garden", "Beauty", "Toys"] -# Generate realistic-looking data with some patterns -values = np.random.randn(len(categories), len(months)) * 20 + 50 -# Add seasonal patterns -for month_idx in [5, 6, 7]: # Summer boost - values[:, month_idx] += 15 -for month_idx in [10, 11]: # Holiday boost - values[:, month_idx] += 25 +# Monthly sales growth (%) relative to annual average — diverging around zero +base = np.random.randn(len(categories), len(months)) * 8 +# Seasonal patterns: summer lift for outdoor/leisure, holiday lift for gifts +for i, cat in enumerate(categories): + if cat in ("Sports", "Toys", "Home & Garden"): + base[i, 5:8] += 12 # Summer + if cat in ("Electronics", "Toys", "Books", "Beauty"): + base[i, 10:12] += 18 # Holiday season + if cat == "Food & Beverage": + base[i, 10:12] += 8 # Modest holiday lift + if cat == "Clothing": + base[i, 3:5] += 10 # Spring fashion + base[i, 8:10] += 10 # Back-to-school +values = np.round(base, 1) # Plot fig = go.Figure( @@ -29,31 +35,40 @@ z=values, x=months, y=categories, - colorscale="RdBu_r", # Diverging colormap + colorscale="RdBu_r", + zmid=0, colorbar={ - "title": {"text": "Sales ($K)", "font": {"size": 20}}, + "title": {"text": "Sales Growth (%)", "font": {"size": 20}}, "tickfont": {"size": 16}, - "thickness": 30, - "len": 0.8, + "ticksuffix": "%", + "thickness": 28, + "len": 0.75, }, - text=np.round(values, 0).astype(int), - texttemplate="%{text}", + text=values, + texttemplate="%{text:+.0f}", textfont={"size": 14}, - hoverongaps=False, + hovertemplate=("%{y} · %{x}
Growth: %{z:+.1f}%"), + xgap=2, + ygap=2, ) ) # Layout fig.update_layout( - title={"text": "heatmap-basic · plotly · pyplots.ai", "font": {"size": 32}, "x": 0.5, "xanchor": "center"}, - xaxis={"title": {"text": "Month", "font": {"size": 24}}, "tickfont": {"size": 18}, "side": "bottom"}, + title={ + "text": "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai", + "font": {"size": 28}, + "x": 0.5, + "xanchor": "center", + }, + xaxis={"title": {"text": "Month", "font": {"size": 22}}, "tickfont": {"size": 18}, "side": "bottom"}, yaxis={ - "title": {"text": "Category", "font": {"size": 24}}, + "title": {"text": "Product Category", "font": {"size": 22}}, "tickfont": {"size": 18}, - "autorange": "reversed", # Categories from top to bottom + "autorange": "reversed", }, template="plotly_white", - margin={"l": 120, "r": 100, "t": 100, "b": 80}, + margin={"l": 140, "r": 110, "t": 100, "b": 80}, ) # Save diff --git a/plots/heatmap-basic/metadata/plotly.yaml b/plots/heatmap-basic/metadata/plotly.yaml index 6d91af15a5..4d42f75ad0 100644 --- a/plots/heatmap-basic/metadata/plotly.yaml +++ b/plots/heatmap-basic/metadata/plotly.yaml @@ -1,16 +1,16 @@ library: plotly specification_id: heatmap-basic created: '2025-12-23T00:46:03Z' -updated: '2025-12-23T00:49:55Z' -generated_by: claude-opus-4-5-20251101 +updated: '2026-02-15T21:25:00+00:00' +generated_by: claude-opus-4-6 workflow_run: 20447950554 issue: 0 -python_version: 3.13.11 -library_version: 6.5.0 +python_version: 3.14.3 +library_version: 6.5.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.html -quality_score: 92 +quality_score: null impl_tags: dependencies: [] techniques: diff --git a/plots/heatmap-basic/specification.md b/plots/heatmap-basic/specification.md index cef917e2dc..4b790ff068 100644 --- a/plots/heatmap-basic/specification.md +++ b/plots/heatmap-basic/specification.md @@ -23,4 +23,4 @@ A heatmap displaying values in a matrix format using color intensity. Each cell' - Use a diverging colormap for data with positive/negative values - Add value annotations in cells when readable - Include a colorbar legend -- Consider clustering rows/columns for better pattern visibility +- Order rows/columns logically (alphabetical, by magnitude, or by similarity) diff --git a/plots/heatmap-basic/specification.yaml b/plots/heatmap-basic/specification.yaml index 8c02cfc6a5..82b0687684 100644 --- a/plots/heatmap-basic/specification.yaml +++ b/plots/heatmap-basic/specification.yaml @@ -6,7 +6,7 @@ title: Basic Heatmap # Specification tracking created: 2025-12-14T09:02:34Z -updated: 2025-12-14T09:02:34Z +updated: 2026-02-15T12:00:00Z issue: 691 suggested: MarkusNeusinger @@ -18,6 +18,7 @@ tags: data_type: - numeric - categorical + - matrix domain: - statistics - general From 0ca8b18c074f0a2a6351b7e0ad5bbfe769c3c00b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Feb 2026 21:31:02 +0000 Subject: [PATCH 2/6] chore(plotly): update quality score 88 and review feedback for heatmap-basic --- plots/heatmap-basic/implementations/plotly.py | 4 +- plots/heatmap-basic/metadata/plotly.yaml | 256 ++++++++++-------- 2 files changed, 140 insertions(+), 120 deletions(-) diff --git a/plots/heatmap-basic/implementations/plotly.py b/plots/heatmap-basic/implementations/plotly.py index a430c48373..6f962385b5 100644 --- a/plots/heatmap-basic/implementations/plotly.py +++ b/plots/heatmap-basic/implementations/plotly.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai heatmap-basic: Basic Heatmap Library: plotly 6.5.2 | Python 3.14.3 -Quality: /100 | Updated: 2026-02-15 +Quality: 88/100 | Updated: 2026-02-15 """ import numpy as np diff --git a/plots/heatmap-basic/metadata/plotly.yaml b/plots/heatmap-basic/metadata/plotly.yaml index 4d42f75ad0..63b6aa6ec2 100644 --- a/plots/heatmap-basic/metadata/plotly.yaml +++ b/plots/heatmap-basic/metadata/plotly.yaml @@ -1,7 +1,7 @@ library: plotly specification_id: heatmap-basic created: '2025-12-23T00:46:03Z' -updated: '2026-02-15T21:25:00+00:00' +updated: '2026-02-15T21:31:01Z' generated_by: claude-opus-4-6 workflow_run: 20447950554 issue: 0 @@ -10,158 +10,172 @@ library_version: 6.5.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.html -quality_score: null +quality_score: 88 impl_tags: dependencies: [] techniques: - - colorbar - - annotations - - html-export + - colorbar + - annotations + - hover-tooltips + - html-export patterns: - - data-generation - - matrix-construction + - data-generation + - iteration-over-groups dataprep: [] styling: - - custom-colormap + - custom-colormap + - edge-highlighting review: strengths: - - Excellent text legibility with well-chosen font sizes for all elements - - 'Perfect implementation of spec requirements: diverging colormap, cell annotations, - and colorbar' - - Realistic business scenario with seasonal patterns visible in the data - - Clean KISS code structure following plotly library guidelines exactly - - Good use of RdBu_r colormap which is colorblind-accessible + - Excellent spec compliance — all four notes from the specification are implemented + (diverging colormap, cell annotations, colorbar, logical ordering) + - Strong Plotly idiom usage — zmid for diverging center, texttemplate with format + specifiers, hovertemplate for interactive tooltips, xgap/ygap for cell separation + - Realistic and engaging dataset with clear seasonal business patterns (summer outdoor/leisure, + holiday gift categories) + - All font sizes explicitly set at appropriate scales for 4800x2700 output + - Clean KISS code structure with appropriate complexity for data generation weaknesses: - - Axis labels could be more descriptive (e.g., "Product Category" instead of just - "Category") - - Colorbar title could include more context (e.g., "Monthly Sales ($K)") - - Could leverage additional Plotly features like custom hover templates for enhanced - interactivity - image_description: The plot displays a heatmap showing monthly sales data across - 8 product categories (Electronics, Clothing, Food, Books, Sports, Home, Beauty, - Toys) for all 12 months (Jan-Dec). The heatmap uses a red-blue diverging colorscale - (RdBu_r), where deep red indicates high values (~100+ $K) and deep blue indicates - low values (near 0 or negative). Each cell contains a numeric annotation showing - the exact value. The title "heatmap-basic · plotly · pyplots.ai" is centered at - the top. The x-axis shows "Month" and the y-axis shows "Category". A colorbar - on the right indicates "Sales ($K)" with values ranging from approximately 0 to - 100. The layout is clean with good proportions, and all text is clearly readable. + - Layout balance could be improved — colorbar creates right-side asymmetry and the + plot area does not maximize canvas utilization + - No subtitle or contextual annotation to guide the viewer toward the seasonal patterns + — the story is there in the data but the viewer must discover it + - Cell annotation text at 14pt is functional but could be slightly larger for easier + reading at a glance + image_description: 'The plot displays an 8x12 heatmap of monthly sales growth percentages + across product categories (Electronics, Clothing, Food & Beverage, Books, Sports, + Home & Garden, Beauty, Toys) and months (Jan-Dec). A diverging RdBu colorscale + is used, centered at 0% — red/warm tones indicate positive growth and blue/cool + tones indicate negative growth. Each cell is annotated with its numerical value + including +/- signs. A vertical colorbar on the right is labeled "Sales Growth + (%)" with percentage tick marks ranging from roughly -20% to +20%. The title reads + "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai" centered at the top. + White gaps separate the cells cleanly. Clear seasonal patterns are visible: summer + months (Jun-Aug) show warm red tones for Sports, Home & Garden, and Toys; November-December + show strong reds for Beauty, Books, Electronics, and Toys (holiday season). The + layout uses a plotly_white template with a clean white background.' criteria_checklist: visual_quality: - score: 37 - max: 40 + score: 27 + max: 30 items: - id: VQ-01 name: Text Legibility - score: 10 - max: 10 + score: 8 + max: 8 passed: true - comment: Title at 32pt, axis labels at 24pt, tick labels at 18pt, cell annotations - at 14pt - all perfectly readable + comment: 'All font sizes explicitly set: title 28pt, axis labels 22pt, ticks + 18pt, cell annotations 14pt, colorbar title 20pt, colorbar ticks 16pt' - id: VQ-02 name: No Overlap - score: 8 - max: 8 + score: 6 + max: 6 passed: true - comment: No overlapping text elements anywhere + comment: No overlapping text; xgap/ygap=2 separates cells cleanly - id: VQ-03 name: Element Visibility - score: 8 - max: 8 + score: 5 + max: 6 passed: true - comment: Cell sizes are well-proportioned, annotations clearly visible within - cells + comment: Cells well-sized for 8x12 grid, though slightly more prominent cells + would help - id: VQ-04 name: Color Accessibility - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: RdBu_r is a colorblind-safe diverging colormap with good contrast + comment: RdBu_r diverging colorscale is colorblind-safe with strong contrast - id: VQ-05 name: Layout Balance - score: 4 - max: 5 - passed: true - comment: Good proportions, slight room for improvement in margins + score: 2 + max: 4 + passed: false + comment: Colorbar creates right-side asymmetry; plot area could use more canvas + space - id: VQ-06 - name: Axis Labels - score: 1 + name: Axis Labels & Title + score: 2 max: 2 passed: true - comment: '"Month" and "Category" are descriptive but lack units (though units - aren''t really applicable here)' - - id: VQ-07 - name: Grid & Legend - score: 1 - max: 2 + comment: Descriptive labels Month and Product Category; colorbar includes + % units + design_excellence: + score: 13 + max: 20 + items: + - id: DE-01 + name: Aesthetic Sophistication + score: 6 + max: 8 passed: true - comment: Colorbar is well-placed with title and readable ticks; no grid lines - (appropriate for heatmap) + comment: 'Strong design: intentional diverging palette centered on zero, plotly_white + template, cell gaps add polish' + - id: DE-02 + name: Visual Refinement + score: 4 + max: 6 + passed: true + comment: plotly_white removes chart junk, cell gaps create separation, generous + margins + - id: DE-03 + name: Data Storytelling + score: 3 + max: 6 + passed: false + comment: Seasonal patterns create natural visual clusters but no subtitle + or callout to guide the viewer spec_compliance: - score: 24 - max: 25 + score: 15 + max: 15 items: - id: SC-01 name: Plot Type - score: 8 - max: 8 - passed: true - comment: Correct heatmap visualization - - id: SC-02 - name: Data Mapping score: 5 max: 5 passed: true - comment: X=months (columns), Y=categories (rows), color=values - correctly - implemented - - id: SC-03 + comment: 'Correct: go.Heatmap' + - id: SC-02 name: Required Features - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: Uses diverging colormap ✓, value annotations ✓, colorbar legend - - id: SC-04 - name: Data Range + comment: 'All spec features present: diverging colormap, value annotations, + colorbar, logically ordered axes' + - id: SC-03 + name: Data Mapping score: 3 max: 3 passed: true - comment: All data visible within axes - - id: SC-05 - name: Legend Accuracy - score: 1 - max: 2 - passed: true - comment: Colorbar title "Sales ($K)" is accurate but could be more descriptive - - id: SC-06 - name: Title Format - score: 2 - max: 2 + comment: X=months, Y=categories, Z=values correctly assigned + - id: SC-04 + name: Title & Legend + score: 3 + max: 3 passed: true - comment: Correctly uses "heatmap-basic · plotly · pyplots.ai" + comment: Title follows required format; colorbar serves as legend data_quality: - score: 18 - max: 20 + score: 14 + max: 15 items: - id: DQ-01 name: Feature Coverage - score: 7 - max: 8 + score: 5 + max: 6 passed: true - comment: Shows variation across categories and months with seasonal patterns - (summer/holiday boosts); includes one negative value (-2 in Beauty/Mar) + comment: Shows positive/negative values, seasonal patterns, cross-category + variation - id: DQ-02 name: Realistic Context - score: 7 - max: 7 + score: 5 + max: 5 passed: true - comment: Monthly retail sales by category is a plausible real-world scenario + comment: Realistic retail scenario with plausible seasonal patterns - id: DQ-03 name: Appropriate Scale score: 4 - max: 5 + max: 4 passed: true - comment: Values 0-106 $K are reasonable for retail sales, though some randomness - leads to slight inconsistencies + comment: Values -21% to +30%, realistic for retail sales growth code_quality: score: 10 max: 10 @@ -171,41 +185,47 @@ review: score: 3 max: 3 passed: true - comment: Simple imports → data → plot → save structure, no functions/classes + comment: 'Clean flow: imports, data, plot, layout, save' - id: CQ-02 name: Reproducibility - score: 3 - max: 3 + score: 2 + max: 2 passed: true - comment: Uses np.random.seed(42) + comment: np.random.seed(42) - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: Only numpy and plotly.graph_objects used + comment: Only numpy and plotly.graph_objects - id: CQ-04 - name: No Deprecated API - score: 1 - max: 1 + name: Code Elegance + score: 2 + max: 2 passed: true - comment: Uses current Plotly API + comment: Clean, Pythonic; seasonal pattern loop is appropriate complexity - id: CQ-05 - name: Output Correct + name: Output & API score: 1 max: 1 passed: true - comment: Saves as plot.png and plot.html + comment: Saves plot.png at 4800x2700 plus HTML export library_features: - score: 3 - max: 5 + score: 9 + max: 10 items: - - id: LF-01 - name: Uses distinctive library features - score: 3 + - id: LM-01 + name: Idiomatic Usage + score: 5 + max: 5 + passed: true + comment: Expert go.Heatmap usage with zmid, texttemplate, hovertemplate, xgap/ygap, + colorbar dict + - id: LM-02 + name: Distinctive Features + score: 4 max: 5 passed: true - comment: Uses go.Heatmap with proper configuration, texttemplate for annotations, - plotly_white template; could leverage more Plotly-specific features like - hover customization - verdict: APPROVED + comment: 'Plotly-specific: hovertemplate, texttemplate formatting, zmid, HTML + export' + verdict: REJECTED From 5511aac554ed482276d966ad4f0fba1b4134f47a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Feb 2026 21:34:20 +0000 Subject: [PATCH 3/6] fix(plotly): address review feedback for heatmap-basic Attempt 1/3 - fixes based on AI review --- plots/heatmap-basic/implementations/plotly.py | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/plots/heatmap-basic/implementations/plotly.py b/plots/heatmap-basic/implementations/plotly.py index 6f962385b5..502f8812a2 100644 --- a/plots/heatmap-basic/implementations/plotly.py +++ b/plots/heatmap-basic/implementations/plotly.py @@ -1,7 +1,6 @@ -""" pyplots.ai +"""pyplots.ai heatmap-basic: Basic Heatmap Library: plotly 6.5.2 | Python 3.14.3 -Quality: 88/100 | Updated: 2026-02-15 """ import numpy as np @@ -41,25 +40,35 @@ "title": {"text": "Sales Growth (%)", "font": {"size": 20}}, "tickfont": {"size": 16}, "ticksuffix": "%", - "thickness": 28, - "len": 0.75, + "thickness": 22, + "len": 0.85, + "x": 1.01, + "xpad": 8, }, text=values, texttemplate="%{text:+.0f}", - textfont={"size": 14}, - hovertemplate=("%{y} · %{x}
Growth: %{z:+.1f}%"), + textfont={"size": 16}, + hovertemplate="%{y} · %{x}
Growth: %{z:+.1f}%", xgap=2, ygap=2, ) ) -# Layout +# Layout — subtitle guides reader to seasonal story in the data fig.update_layout( title={ - "text": "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai", + "text": ( + "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai" + "
" + "Retail categories show clear seasonal surges — " + "summer outdoor/leisure peaks and Q4 holiday gift spikes" + "" + ), "font": {"size": 28}, "x": 0.5, "xanchor": "center", + "y": 0.97, + "yanchor": "top", }, xaxis={"title": {"text": "Month", "font": {"size": 22}}, "tickfont": {"size": 18}, "side": "bottom"}, yaxis={ @@ -68,7 +77,9 @@ "autorange": "reversed", }, template="plotly_white", - margin={"l": 140, "r": 110, "t": 100, "b": 80}, + margin={"l": 160, "r": 80, "t": 120, "b": 70}, + width=1600, + height=900, ) # Save From 608704d460e4b5df99477f2171f373b390f8e3f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Feb 2026 21:38:11 +0000 Subject: [PATCH 4/6] chore(plotly): update quality score 89 and review feedback for heatmap-basic --- plots/heatmap-basic/implementations/plotly.py | 3 +- plots/heatmap-basic/metadata/plotly.yaml | 132 +++++++++--------- 2 files changed, 69 insertions(+), 66 deletions(-) diff --git a/plots/heatmap-basic/implementations/plotly.py b/plots/heatmap-basic/implementations/plotly.py index 502f8812a2..c477fb5138 100644 --- a/plots/heatmap-basic/implementations/plotly.py +++ b/plots/heatmap-basic/implementations/plotly.py @@ -1,6 +1,7 @@ -"""pyplots.ai +""" pyplots.ai heatmap-basic: Basic Heatmap Library: plotly 6.5.2 | Python 3.14.3 +Quality: 89/100 | Updated: 2026-02-15 """ import numpy as np diff --git a/plots/heatmap-basic/metadata/plotly.yaml b/plots/heatmap-basic/metadata/plotly.yaml index 63b6aa6ec2..cb58c63a71 100644 --- a/plots/heatmap-basic/metadata/plotly.yaml +++ b/plots/heatmap-basic/metadata/plotly.yaml @@ -1,7 +1,7 @@ library: plotly specification_id: heatmap-basic created: '2025-12-23T00:46:03Z' -updated: '2026-02-15T21:31:01Z' +updated: '2026-02-15T21:38:10Z' generated_by: claude-opus-4-6 workflow_run: 20447950554 issue: 0 @@ -10,7 +10,7 @@ library_version: 6.5.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.html -quality_score: 88 +quality_score: 89 impl_tags: dependencies: [] techniques: @@ -27,33 +27,36 @@ impl_tags: - edge-highlighting review: strengths: - - Excellent spec compliance — all four notes from the specification are implemented - (diverging colormap, cell annotations, colorbar, logical ordering) - - Strong Plotly idiom usage — zmid for diverging center, texttemplate with format - specifiers, hovertemplate for interactive tooltips, xgap/ygap for cell separation - - Realistic and engaging dataset with clear seasonal business patterns (summer outdoor/leisure, - holiday gift categories) - - All font sizes explicitly set at appropriate scales for 4800x2700 output - - Clean KISS code structure with appropriate complexity for data generation + - Excellent text legibility with all font sizes explicitly configured for target + resolution + - Effective diverging RdBu colorscale centered at zero with zmid — immediately reveals + positive vs. negative growth + - 'Thoughtful data storytelling: subtitle guides reader to seasonal patterns, data + engineered with realistic seasonal effects (summer outdoor peaks, Q4 holiday spikes, + spring fashion, back-to-school)' + - 'Rich Plotly-specific features: hovertemplate with HTML formatting, HTML subtitle, + interactive HTML alongside static PNG' + - Clean KISS code structure with elegant seasonal pattern generation loop weaknesses: - - Layout balance could be improved — colorbar creates right-side asymmetry and the - plot area does not maximize canvas utilization - - No subtitle or contextual annotation to guide the viewer toward the seasonal patterns - — the story is there in the data but the viewer must discover it - - Cell annotation text at 14pt is functional but could be slightly larger for easier - reading at a glance - image_description: 'The plot displays an 8x12 heatmap of monthly sales growth percentages - across product categories (Electronics, Clothing, Food & Beverage, Books, Sports, - Home & Garden, Beauty, Toys) and months (Jan-Dec). A diverging RdBu colorscale - is used, centered at 0% — red/warm tones indicate positive growth and blue/cool - tones indicate negative growth. Each cell is annotated with its numerical value - including +/- signs. A vertical colorbar on the right is labeled "Sales Growth - (%)" with percentage tick marks ranging from roughly -20% to +20%. The title reads - "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai" centered at the top. - White gaps separate the cells cleanly. Clear seasonal patterns are visible: summer - months (Jun-Aug) show warm red tones for Sports, Home & Garden, and Toys; November-December - show strong reds for Beauty, Books, Electronics, and Toys (holiday season). The - layout uses a plotly_white template with a clean white background.' + - 'Canvas utilization could be tighter — left margin (160px) and colorbar placement + leave the heatmap area somewhat constrained with moderate whitespace (VQ-05: 2/4)' + - 'Aesthetic polish is strong but falls short of publication-ready — could benefit + from a custom font family or more typographic refinement (DE-01: 6/8)' + - Cell annotations using texttemplate format +.0f rounds to integers, losing the + decimal precision available in the data + image_description: 'The plot displays a heatmap of monthly sales growth percentages + for 8 retail product categories (Electronics, Clothing, Food & Beverage, Books, + Sports, Home & Garden, Beauty, Toys) across all 12 months (Jan–Dec). A diverging + RdBu colorscale is used, centered at zero — blue tones for negative growth, red/warm + tones for positive growth. Each cell contains an annotated value with sign (e.g., + +14.3, -15.3). The title reads "Monthly Sales Growth · heatmap-basic · plotly + · pyplots.ai" with a gray subtitle: "Retail categories show clear seasonal surges + — summer outdoor/leisure peaks and Q4 holiday gift spikes." A colorbar on the + right shows "Sales Growth (%)" ranging from roughly -20% to +20%. Clear seasonal + patterns are visible: Sports, Home & Garden, and Toys show summer peaks (Jun–Aug + in dark red), while Electronics, Toys, Books, and Beauty show holiday spikes (Nov–Dec + in deep red/maroon). Clothing shows spring (Apr) and back-to-school (Sep) bumps. + The background is clean white with subtle gaps between cells.' criteria_checklist: visual_quality: score: 27 @@ -64,43 +67,42 @@ review: score: 8 max: 8 passed: true - comment: 'All font sizes explicitly set: title 28pt, axis labels 22pt, ticks - 18pt, cell annotations 14pt, colorbar title 20pt, colorbar ticks 16pt' + comment: 'All font sizes explicitly set: title 28pt, axis titles 22pt, ticks + 18pt, cell text 16pt, colorbar title 20pt' - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No overlapping text; xgap/ygap=2 separates cells cleanly + comment: No overlapping elements; annotations fit within cells - id: VQ-03 name: Element Visibility score: 5 max: 6 passed: true - comment: Cells well-sized for 8x12 grid, though slightly more prominent cells - would help + comment: Cells well-sized for 8x12 matrix with 2px gaps - id: VQ-04 name: Color Accessibility score: 4 max: 4 passed: true - comment: RdBu_r diverging colorscale is colorblind-safe with strong contrast + comment: RdBu diverging colorscale is colorblind-safe - id: VQ-05 name: Layout Balance score: 2 max: 4 passed: false - comment: Colorbar creates right-side asymmetry; plot area could use more canvas - space + comment: Left margin 160px and colorbar leave heatmap area somewhat constrained; + moderate unused whitespace - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Descriptive labels Month and Product Category; colorbar includes - % units + comment: 'Descriptive labels with units: Month, Product Category, Sales Growth + (%)' design_excellence: - score: 13 + score: 14 max: 20 items: - id: DE-01 @@ -108,22 +110,22 @@ review: score: 6 max: 8 passed: true - comment: 'Strong design: intentional diverging palette centered on zero, plotly_white - template, cell gaps add polish' + comment: Strong design with RdBu diverging scale, plotly_white template, gray + subtitle, styled colorbar - id: DE-02 name: Visual Refinement score: 4 max: 6 passed: true - comment: plotly_white removes chart junk, cell gaps create separation, generous - margins + comment: Good refinement with clean template, cell gaps, custom margins, centered + title with subtitle - id: DE-03 name: Data Storytelling - score: 3 + score: 4 max: 6 - passed: false - comment: Seasonal patterns create natural visual clusters but no subtitle - or callout to guide the viewer + passed: true + comment: Subtitle guides reader to seasonal story; data engineered with realistic + patterns; color divergence creates visual hierarchy spec_compliance: score: 15 max: 15 @@ -133,26 +135,27 @@ review: score: 5 max: 5 passed: true - comment: 'Correct: go.Heatmap' + comment: Correct basic heatmap with color intensity - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All spec features present: diverging colormap, value annotations, - colorbar, logically ordered axes' + comment: 'All spec features: diverging colormap, cell annotations, colorbar, + logically ordered rows/columns' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: X=months, Y=categories, Z=values correctly assigned + comment: X=months, Y=categories, Z=values correctly mapped - id: SC-04 - name: Title & Legend + name: Title Format score: 3 max: 3 passed: true - comment: Title follows required format; colorbar serves as legend + comment: 'Correct format: Monthly Sales Growth · heatmap-basic · plotly · + pyplots.ai' data_quality: score: 14 max: 15 @@ -162,8 +165,7 @@ review: score: 5 max: 6 passed: true - comment: Shows positive/negative values, seasonal patterns, cross-category - variation + comment: Shows positive and negative values, range of magnitudes, clear patterns - id: DQ-02 name: Realistic Context score: 5 @@ -175,7 +177,7 @@ review: score: 4 max: 4 passed: true - comment: Values -21% to +30%, realistic for retail sales growth + comment: Values range -21% to +30%, realistic for monthly sales growth code_quality: score: 10 max: 10 @@ -185,7 +187,7 @@ review: score: 3 max: 3 passed: true - comment: 'Clean flow: imports, data, plot, layout, save' + comment: Clean imports → data → plot → layout → save - id: CQ-02 name: Reproducibility score: 2 @@ -197,20 +199,20 @@ review: score: 2 max: 2 passed: true - comment: Only numpy and plotly.graph_objects + comment: Only numpy and plotly.graph_objects imported - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Clean, Pythonic; seasonal pattern loop is appropriate complexity + comment: Clean, Pythonic seasonal pattern generation - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves plot.png at 4800x2700 plus HTML export - library_features: + comment: Saves plot.png at 4800x2700 via scale=3 + library_mastery: score: 9 max: 10 items: @@ -219,13 +221,13 @@ review: score: 5 max: 5 passed: true - comment: Expert go.Heatmap usage with zmid, texttemplate, hovertemplate, xgap/ygap, - colorbar dict + comment: Expert go.Heatmap usage with zmid, texttemplate, hovertemplate, colorbar + dict - id: LM-02 name: Distinctive Features score: 4 max: 5 passed: true - comment: 'Plotly-specific: hovertemplate, texttemplate formatting, zmid, HTML - export' + comment: 'Plotly-specific: hovertemplate with HTML, HTML subtitle, interactive + HTML export, zmid for diverging center' verdict: REJECTED From fc609bd8943de0c76d5bf4fb1cd91ede0650192a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Feb 2026 21:40:54 +0000 Subject: [PATCH 5/6] fix(plotly): address review feedback for heatmap-basic Attempt 2/3 - fixes based on AI review --- plots/heatmap-basic/implementations/plotly.py | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/plots/heatmap-basic/implementations/plotly.py b/plots/heatmap-basic/implementations/plotly.py index c477fb5138..5e0e7c51f7 100644 --- a/plots/heatmap-basic/implementations/plotly.py +++ b/plots/heatmap-basic/implementations/plotly.py @@ -1,7 +1,6 @@ -""" pyplots.ai +"""pyplots.ai heatmap-basic: Basic Heatmap Library: plotly 6.5.2 | Python 3.14.3 -Quality: 89/100 | Updated: 2026-02-15 """ import numpy as np @@ -29,6 +28,9 @@ base[i, 8:10] += 10 # Back-to-school values = np.round(base, 1) +# Font family for publication-quality typography +font_family = "Palatino, Georgia, serif" + # Plot fig = go.Figure( data=go.Heatmap( @@ -38,49 +40,56 @@ colorscale="RdBu_r", zmid=0, colorbar={ - "title": {"text": "Sales Growth (%)", "font": {"size": 20}}, - "tickfont": {"size": 16}, + "title": {"text": "Sales Growth (%)", "font": {"size": 20, "family": font_family}}, + "tickfont": {"size": 16, "family": font_family}, "ticksuffix": "%", - "thickness": 22, - "len": 0.85, - "x": 1.01, - "xpad": 8, + "thickness": 20, + "len": 0.75, + "x": 1.005, + "xpad": 4, + "outlinewidth": 0, }, text=values, - texttemplate="%{text:+.0f}", - textfont={"size": 16}, + texttemplate="%{text:+.1f}", + textfont={"size": 15, "family": font_family}, hovertemplate="%{y} · %{x}
Growth: %{z:+.1f}%", xgap=2, ygap=2, ) ) -# Layout — subtitle guides reader to seasonal story in the data +# Layout — tighter margins maximise heatmap area; serif font elevates polish fig.update_layout( title={ "text": ( "Monthly Sales Growth · heatmap-basic · plotly · pyplots.ai" - "
" + "
" "Retail categories show clear seasonal surges — " "summer outdoor/leisure peaks and Q4 holiday gift spikes" "" ), - "font": {"size": 28}, + "font": {"size": 28, "family": font_family, "color": "#1a1a1a"}, "x": 0.5, "xanchor": "center", "y": 0.97, "yanchor": "top", }, - xaxis={"title": {"text": "Month", "font": {"size": 22}}, "tickfont": {"size": 18}, "side": "bottom"}, + xaxis={ + "title": {"text": "Month", "font": {"size": 22, "family": font_family, "color": "#333"}}, + "tickfont": {"size": 18, "family": font_family, "color": "#444"}, + "side": "bottom", + }, yaxis={ - "title": {"text": "Product Category", "font": {"size": 22}}, - "tickfont": {"size": 18}, + "title": {"text": "Product Category", "font": {"size": 22, "family": font_family, "color": "#333"}}, + "tickfont": {"size": 18, "family": font_family, "color": "#444"}, "autorange": "reversed", }, template="plotly_white", - margin={"l": 160, "r": 80, "t": 120, "b": 70}, + margin={"l": 140, "r": 60, "t": 120, "b": 65}, width=1600, height=900, + paper_bgcolor="#fafafa", + plot_bgcolor="#fafafa", ) # Save From bc83a9b1ebbe61e65f71a6e97105560439208eae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Feb 2026 21:46:06 +0000 Subject: [PATCH 6/6] chore(plotly): update quality score 92 and review feedback for heatmap-basic --- plots/heatmap-basic/implementations/plotly.py | 3 +- plots/heatmap-basic/metadata/plotly.yaml | 142 +++++++++--------- 2 files changed, 71 insertions(+), 74 deletions(-) diff --git a/plots/heatmap-basic/implementations/plotly.py b/plots/heatmap-basic/implementations/plotly.py index 5e0e7c51f7..1874df8f9b 100644 --- a/plots/heatmap-basic/implementations/plotly.py +++ b/plots/heatmap-basic/implementations/plotly.py @@ -1,6 +1,7 @@ -"""pyplots.ai +""" pyplots.ai heatmap-basic: Basic Heatmap Library: plotly 6.5.2 | Python 3.14.3 +Quality: 92/100 | Updated: 2026-02-15 """ import numpy as np diff --git a/plots/heatmap-basic/metadata/plotly.yaml b/plots/heatmap-basic/metadata/plotly.yaml index cb58c63a71..216eb498ef 100644 --- a/plots/heatmap-basic/metadata/plotly.yaml +++ b/plots/heatmap-basic/metadata/plotly.yaml @@ -1,7 +1,7 @@ library: plotly specification_id: heatmap-basic created: '2025-12-23T00:46:03Z' -updated: '2026-02-15T21:38:10Z' +updated: '2026-02-15T21:46:06Z' generated_by: claude-opus-4-6 workflow_run: 20447950554 issue: 0 @@ -10,7 +10,7 @@ library_version: 6.5.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/heatmap-basic/plotly/plot.html -quality_score: 89 +quality_score: 92 impl_tags: dependencies: [] techniques: @@ -27,39 +27,37 @@ impl_tags: - edge-highlighting review: strengths: - - Excellent text legibility with all font sizes explicitly configured for target - resolution - - Effective diverging RdBu colorscale centered at zero with zmid — immediately reveals - positive vs. negative growth - - 'Thoughtful data storytelling: subtitle guides reader to seasonal patterns, data - engineered with realistic seasonal effects (summer outdoor peaks, Q4 holiday spikes, - spring fashion, back-to-school)' - - 'Rich Plotly-specific features: hovertemplate with HTML formatting, HTML subtitle, - interactive HTML alongside static PNG' - - Clean KISS code structure with elegant seasonal pattern generation loop + - Excellent data storytelling with realistic seasonal retail patterns that make + the heatmap informative and engaging + - Publication-quality typography using serif fonts (Palatino/Georgia) with carefully + set font sizes at every level + - Diverging RdBu colorscale centered at zero with signed numeric annotations in + every cell — clear and informative + - Clean code structure with appropriate data generation complexity for realistic + seasonal patterns + - Plotly-idiomatic usage of hovertemplate, texttemplate, and HTML export alongside + static PNG weaknesses: - - 'Canvas utilization could be tighter — left margin (160px) and colorbar placement - leave the heatmap area somewhat constrained with moderate whitespace (VQ-05: 2/4)' - - 'Aesthetic polish is strong but falls short of publication-ready — could benefit - from a custom font family or more typographic refinement (DE-01: 6/8)' - - Cell annotations using texttemplate format +.0f rounds to integers, losing the - decimal precision available in the data - image_description: 'The plot displays a heatmap of monthly sales growth percentages - for 8 retail product categories (Electronics, Clothing, Food & Beverage, Books, - Sports, Home & Garden, Beauty, Toys) across all 12 months (Jan–Dec). A diverging - RdBu colorscale is used, centered at zero — blue tones for negative growth, red/warm - tones for positive growth. Each cell contains an annotated value with sign (e.g., - +14.3, -15.3). The title reads "Monthly Sales Growth · heatmap-basic · plotly - · pyplots.ai" with a gray subtitle: "Retail categories show clear seasonal surges - — summer outdoor/leisure peaks and Q4 holiday gift spikes." A colorbar on the - right shows "Sales Growth (%)" ranging from roughly -20% to +20%. Clear seasonal - patterns are visible: Sports, Home & Garden, and Toys show summer peaks (Jun–Aug - in dark red), while Electronics, Toys, Books, and Beauty show holiday spikes (Nov–Dec - in deep red/maroon). Clothing shows spring (Apr) and back-to-school (Sep) bumps. - The background is clean white with subtle gaps between cells.' + - Right margin slightly tight — colorbar Sales Growth title is close to the canvas + edge; increasing right margin or adjusting colorbar position would improve balance + - Could leverage more distinctive Plotly features (e.g., custom hoverinfo with category-specific + details, or zmin/zmax for symmetric range) + image_description: 'The plot displays an 8×12 heatmap of monthly sales growth percentages + across retail product categories (Electronics, Clothing, Food & Beverage, Books, + Sports, Home & Garden, Beauty, Toys) over 12 months (Jan–Dec). A diverging RdBu + colorscale is used, centered at zero: deep red cells indicate strong positive + growth (up to ~30%), deep blue cells indicate strong negative growth (down to + ~-21%), and near-white cells are close to zero. Every cell contains a signed numeric + annotation (e.g., "+20.2", "-15.3"). The title reads "Monthly Sales Growth · heatmap-basic + · plotly · pyplots.ai" with a gray subtitle describing seasonal patterns. Axes + are labeled "Month" (x) and "Product Category" (y). A vertical colorbar on the + right shows "Sales Growth (%)" with percentage tick marks. Cells are separated + by small gaps. The background is a light off-white (#fafafa), and the typography + uses a serif font (Palatino/Georgia). The layout is landscape format at 1600×900 + (scaled 3×).' criteria_checklist: visual_quality: - score: 27 + score: 28 max: 30 items: - id: VQ-01 @@ -68,64 +66,63 @@ review: max: 8 passed: true comment: 'All font sizes explicitly set: title 28pt, axis titles 22pt, ticks - 18pt, cell text 16pt, colorbar title 20pt' + 18pt, annotations 15pt, colorbar title 20pt, colorbar ticks 16pt' - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No overlapping elements; annotations fit within cells + comment: No overlapping text; cell gaps separate annotations cleanly - id: VQ-03 name: Element Visibility - score: 5 + score: 6 max: 6 passed: true - comment: Cells well-sized for 8x12 matrix with 2px gaps + comment: Heatmap cells well-sized for 8x12 matrix, all clearly visible - id: VQ-04 name: Color Accessibility score: 4 max: 4 passed: true - comment: RdBu diverging colorscale is colorblind-safe + comment: RdBu diverging colormap is colorblind-distinguishable - id: VQ-05 name: Layout Balance score: 2 max: 4 passed: false - comment: Left margin 160px and colorbar leave heatmap area somewhat constrained; - moderate unused whitespace + comment: Heatmap fills canvas well but colorbar label slightly tight against + right edge - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: 'Descriptive labels with units: Month, Product Category, Sales Growth - (%)' + comment: Descriptive labels with units on colorbar design_excellence: - score: 14 + score: 16 max: 20 items: - id: DE-01 name: Aesthetic Sophistication - score: 6 + score: 7 max: 8 passed: true - comment: Strong design with RdBu diverging scale, plotly_white template, gray - subtitle, styled colorbar + comment: Publication-quality serif typography, intentional diverging colormap, + cell gaps, muted background, styled colorbar - id: DE-02 name: Visual Refinement - score: 4 + score: 5 max: 6 passed: true - comment: Good refinement with clean template, cell gaps, custom margins, centered - title with subtitle + comment: plotly_white template, cell gaps, styled subtitle with hierarchy, + generous whitespace - id: DE-03 name: Data Storytelling score: 4 max: 6 passed: true - comment: Subtitle guides reader to seasonal story; data engineered with realistic - patterns; color divergence creates visual hierarchy + comment: Seasonal patterns visually evident; subtitle states insight; color + intensity guides viewer spec_compliance: score: 15 max: 15 @@ -135,49 +132,49 @@ review: score: 5 max: 5 passed: true - comment: Correct basic heatmap with color intensity + comment: Correct heatmap with matrix format and color intensity mapping - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All spec features: diverging colormap, cell annotations, colorbar, - logically ordered rows/columns' + comment: Diverging colormap, value annotations, colorbar legend, logically + ordered categories - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: X=months, Y=categories, Z=values correctly mapped + comment: X=months, Y=categories, values mapped to color correctly - id: SC-04 - name: Title Format + name: Title & Legend score: 3 max: 3 passed: true - comment: 'Correct format: Monthly Sales Growth · heatmap-basic · plotly · - pyplots.ai' + comment: Title format correct; colorbar serves as legend data_quality: - score: 14 + score: 15 max: 15 items: - id: DQ-01 name: Feature Coverage - score: 5 + score: 6 max: 6 passed: true - comment: Shows positive and negative values, range of magnitudes, clear patterns + comment: Full range of positive and negative values, clear seasonal patterns, + varying magnitudes - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: Realistic retail scenario with plausible seasonal patterns + comment: Retail sales growth with plausible seasonal patterns - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: Values range -21% to +30%, realistic for monthly sales growth + comment: Growth percentages -21% to +30% realistic for retail code_quality: score: 10 max: 10 @@ -187,13 +184,13 @@ review: score: 3 max: 3 passed: true - comment: Clean imports → data → plot → layout → save + comment: Clean Imports, Data, Plot, Save structure - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: np.random.seed(42) + comment: np.random.seed(42) set - id: CQ-03 name: Clean Imports score: 2 @@ -205,15 +202,15 @@ review: score: 2 max: 2 passed: true - comment: Clean, Pythonic seasonal pattern generation + comment: Clean Pythonic code with appropriate complexity - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves plot.png at 4800x2700 via scale=3 + comment: Saves plot.png with correct dimensions and scale=3 library_mastery: - score: 9 + score: 8 max: 10 items: - id: LM-01 @@ -221,13 +218,12 @@ review: score: 5 max: 5 passed: true - comment: Expert go.Heatmap usage with zmid, texttemplate, hovertemplate, colorbar - dict + comment: Expert use of go.Heatmap with colorscale, zmid, texttemplate, hovertemplate - id: LM-02 name: Distinctive Features - score: 4 + score: 3 max: 5 passed: true - comment: 'Plotly-specific: hovertemplate with HTML, HTML subtitle, interactive - HTML export, zmid for diverging center' - verdict: REJECTED + comment: Uses hovertemplate, HTML export, texttemplate formatting; standard + Plotly patterns + verdict: APPROVED