From e65f3b66903f36098040fafe08be9ab7333f1d7d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 17:48:59 +0000 Subject: [PATCH 1/3] feat(altair): implement scatter-annotated --- .../implementations/altair.py | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 plots/scatter-annotated/implementations/altair.py diff --git a/plots/scatter-annotated/implementations/altair.py b/plots/scatter-annotated/implementations/altair.py new file mode 100644 index 0000000000..f7bcbc405f --- /dev/null +++ b/plots/scatter-annotated/implementations/altair.py @@ -0,0 +1,56 @@ +"""pyplots.ai +scatter-annotated: Annotated Scatter Plot with Text Labels +Library: altair | Python 3.13 +Quality: pending | Created: 2025-12-30 +""" + +import altair as alt +import numpy as np +import pandas as pd + + +# Data - Selected tech companies showing range of revenue/profit metrics +np.random.seed(42) +companies = ["NVIDIA", "Apple", "Microsoft", "Amazon", "Google", "Meta", "Adobe", "Oracle", "Tesla", "Intel"] +# Revenue (billions USD) - realistic values +revenue = np.array([61, 385, 211, 574, 307, 135, 19, 50, 97, 63]) +# Profit margin (%) - realistic values +profit_margin = np.array([55, 25, 35, 6, 22, 20, 34, 26, 11, 8]) + +df = pd.DataFrame({"company": companies, "revenue": revenue, "profit_margin": profit_margin}) + +# Points layer +points = ( + alt.Chart(df) + .mark_point(size=250, filled=True, opacity=0.7, color="#306998") + .encode( + x=alt.X("revenue:Q", title="Revenue (Billions USD)", scale=alt.Scale(domain=[0, 620])), + y=alt.Y("profit_margin:Q", title="Profit Margin (%)", scale=alt.Scale(domain=[0, 60])), + tooltip=["company:N", "revenue:Q", "profit_margin:Q"], + ) +) + +# Text labels layer +labels = ( + alt.Chart(df) + .mark_text(align="left", dx=12, dy=-8, fontSize=18, fontWeight="bold", color="#333333") + .encode(x=alt.X("revenue:Q"), y=alt.Y("profit_margin:Q"), text="company:N") +) + +# Combine layers +chart = ( + (points + labels) + .properties( + width=1600, + height=900, + title=alt.Title(text="scatter-annotated · altair · pyplots.ai", fontSize=28, anchor="middle"), + ) + .configure_axis(labelFontSize=18, titleFontSize=22, gridOpacity=0.3) + .configure_view(strokeWidth=0) +) + +# Save as PNG (4800x2700 with scale_factor=3) +chart.save("plot.png", scale_factor=3.0) + +# Save as HTML for interactivity +chart.save("plot.html") From eff7da30b894db5895bda4045907347a18e240c7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 17:49:20 +0000 Subject: [PATCH 2/3] chore(altair): add metadata for scatter-annotated --- plots/scatter-annotated/metadata/altair.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plots/scatter-annotated/metadata/altair.yaml diff --git a/plots/scatter-annotated/metadata/altair.yaml b/plots/scatter-annotated/metadata/altair.yaml new file mode 100644 index 0000000000..e739c931f5 --- /dev/null +++ b/plots/scatter-annotated/metadata/altair.yaml @@ -0,0 +1,19 @@ +# Per-library metadata for altair implementation of scatter-annotated +# Auto-generated by impl-generate.yml + +library: altair +specification_id: scatter-annotated +created: '2025-12-30T17:49:20Z' +updated: '2025-12-30T17:49:20Z' +generated_by: claude-opus-4-5-20251101 +workflow_run: 20602453376 +issue: 0 +python_version: 3.13.11 +library_version: 6.0.0 +preview_url: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/altair/plot.png +preview_thumb: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/altair/plot_thumb.png +preview_html: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/altair/plot.html +quality_score: null +review: + strengths: [] + weaknesses: [] From 251afd7d8be4d4447c806d39210e576d980bebfc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 17:59:04 +0000 Subject: [PATCH 3/3] chore(altair): update quality score 91 and review feedback for scatter-annotated --- .../implementations/altair.py | 6 +++--- plots/scatter-annotated/metadata/altair.yaml | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/plots/scatter-annotated/implementations/altair.py b/plots/scatter-annotated/implementations/altair.py index f7bcbc405f..292a4a88e1 100644 --- a/plots/scatter-annotated/implementations/altair.py +++ b/plots/scatter-annotated/implementations/altair.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai scatter-annotated: Annotated Scatter Plot with Text Labels -Library: altair | Python 3.13 -Quality: pending | Created: 2025-12-30 +Library: altair 6.0.0 | Python 3.13.11 +Quality: 91/100 | Created: 2025-12-30 """ import altair as alt diff --git a/plots/scatter-annotated/metadata/altair.yaml b/plots/scatter-annotated/metadata/altair.yaml index e739c931f5..9d6fb8e8fb 100644 --- a/plots/scatter-annotated/metadata/altair.yaml +++ b/plots/scatter-annotated/metadata/altair.yaml @@ -1,10 +1,7 @@ -# Per-library metadata for altair implementation of scatter-annotated -# Auto-generated by impl-generate.yml - library: altair specification_id: scatter-annotated created: '2025-12-30T17:49:20Z' -updated: '2025-12-30T17:49:20Z' +updated: '2025-12-30T17:59:04Z' generated_by: claude-opus-4-5-20251101 workflow_run: 20602453376 issue: 0 @@ -13,7 +10,15 @@ library_version: 6.0.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/altair/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/altair/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/altair/plot.html -quality_score: null +quality_score: 91 review: - strengths: [] - weaknesses: [] + strengths: + - Excellent text legibility with appropriate font sizes for high-resolution output + - Clean declarative layer composition using Altair's grammar of graphics + - Realistic, neutral dataset with recognizable tech companies and accurate financials + - Smart label positioning with consistent dx/dy offsets to avoid point overlap + - Proper use of tooltips for interactivity in HTML output + weaknesses: + - Missing connector lines/arrows from labels to points as mentioned in specification + notes + - Could leverage more Altair-specific features like conditional formatting or selections