From 3ad2d4fe5836bef59930fa3a0b20e19f1cc22700 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 09:36:49 +0000 Subject: [PATCH 1/3] feat(letsplot): implement contour-density MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../implementations/letsplot.py | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 plots/contour-density/implementations/letsplot.py diff --git a/plots/contour-density/implementations/letsplot.py b/plots/contour-density/implementations/letsplot.py new file mode 100644 index 0000000000..f5464a9824 --- /dev/null +++ b/plots/contour-density/implementations/letsplot.py @@ -0,0 +1,59 @@ +"""pyplots.ai +contour-density: Density Contour Plot +Library: lets-plot | Python 3.13 +Quality: pending | Created: 2025-12-30 +""" + +import numpy as np +import pandas as pd +from lets_plot import * + + +LetsPlot.setup_html() + +# Data - two clusters with different spreads for bivariate distribution +np.random.seed(42) + +# Cluster 1: Dense core cluster (temperature measurements) +n1 = 400 +x1 = np.random.normal(loc=22, scale=3, size=n1) +y1 = np.random.normal(loc=55, scale=8, size=n1) + +# Cluster 2: More diffuse cluster +n2 = 300 +x2 = np.random.normal(loc=32, scale=5, size=n2) +y2 = np.random.normal(loc=75, scale=10, size=n2) + +# Cluster 3: Small dense cluster +n3 = 150 +x3 = np.random.normal(loc=15, scale=2, size=n3) +y3 = np.random.normal(loc=80, scale=5, size=n3) + +# Combine clusters +x = np.concatenate([x1, x2, x3]) +y = np.concatenate([y1, y2, y3]) + +df = pd.DataFrame({"temperature": x, "humidity": y}) + +# Plot - density contour with scatter overlay for context +plot = ( + ggplot(df, aes(x="temperature", y="humidity")) + + geom_density2d(color="#306998", size=1.2, bins=10) + + geom_point(color="#FFD43B", alpha=0.3, size=2) + + labs(x="Temperature (°C)", y="Relative Humidity (%)", title="contour-density · letsplot · pyplots.ai") + + theme_minimal() + + theme( + axis_title=element_text(size=20), + axis_text=element_text(size=16), + plot_title=element_text(size=24), + panel_grid=element_line(color="#888888", size=0.3), + panel_grid_minor=element_blank(), + ) + + ggsize(1600, 900) +) + +# Save as PNG (scale 3x for 4800 × 2700 px) +ggsave(plot, "plot.png", path=".", scale=3) + +# Save as HTML for interactive version +ggsave(plot, "plot.html", path=".") From ca1f8945bfe9d85d2a0b4508d1de6977c82961cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 09:37:09 +0000 Subject: [PATCH 2/3] chore(letsplot): add metadata for contour-density --- plots/contour-density/metadata/letsplot.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plots/contour-density/metadata/letsplot.yaml diff --git a/plots/contour-density/metadata/letsplot.yaml b/plots/contour-density/metadata/letsplot.yaml new file mode 100644 index 0000000000..6553d988c3 --- /dev/null +++ b/plots/contour-density/metadata/letsplot.yaml @@ -0,0 +1,19 @@ +# Per-library metadata for letsplot implementation of contour-density +# Auto-generated by impl-generate.yml + +library: letsplot +specification_id: contour-density +created: '2025-12-30T09:37:09Z' +updated: '2025-12-30T09:37:09Z' +generated_by: claude-opus-4-5-20251101 +workflow_run: 20593405154 +issue: 0 +python_version: 3.13.11 +library_version: 4.8.2 +preview_url: https://storage.googleapis.com/pyplots-images/plots/contour-density/letsplot/plot.png +preview_thumb: https://storage.googleapis.com/pyplots-images/plots/contour-density/letsplot/plot_thumb.png +preview_html: https://storage.googleapis.com/pyplots-images/plots/contour-density/letsplot/plot.html +quality_score: null +review: + strengths: [] + weaknesses: [] From 741ba8a5ea1a41cb22ac71676875a66278c9f96c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 09:47:24 +0000 Subject: [PATCH 3/3] chore(letsplot): update quality score 92 and review feedback for contour-density --- .../implementations/letsplot.py | 6 +++--- plots/contour-density/metadata/letsplot.yaml | 21 ++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/plots/contour-density/implementations/letsplot.py b/plots/contour-density/implementations/letsplot.py index f5464a9824..bc9292464c 100644 --- a/plots/contour-density/implementations/letsplot.py +++ b/plots/contour-density/implementations/letsplot.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai contour-density: Density Contour Plot -Library: lets-plot | Python 3.13 -Quality: pending | Created: 2025-12-30 +Library: letsplot 4.8.2 | Python 3.13.11 +Quality: 92/100 | Created: 2025-12-30 """ import numpy as np diff --git a/plots/contour-density/metadata/letsplot.yaml b/plots/contour-density/metadata/letsplot.yaml index 6553d988c3..259809a6e3 100644 --- a/plots/contour-density/metadata/letsplot.yaml +++ b/plots/contour-density/metadata/letsplot.yaml @@ -1,10 +1,7 @@ -# Per-library metadata for letsplot implementation of contour-density -# Auto-generated by impl-generate.yml - library: letsplot specification_id: contour-density created: '2025-12-30T09:37:09Z' -updated: '2025-12-30T09:37:09Z' +updated: '2025-12-30T09:47:24Z' generated_by: claude-opus-4-5-20251101 workflow_run: 20593405154 issue: 0 @@ -13,7 +10,17 @@ library_version: 4.8.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/contour-density/letsplot/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/contour-density/letsplot/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/contour-density/letsplot/plot.html -quality_score: null +quality_score: 92 review: - strengths: [] - weaknesses: [] + strengths: + - Excellent visualization of three distinct density clusters with clear concentric + contour lines + - Good use of scatter overlay with low alpha providing context without overwhelming + the contours + - Proper ggplot2-style grammar with geom_density2d following lets-plot conventions + - Axis labels include appropriate units (°C, %) and are descriptive + - 'Title follows the exact required format: spec-id · library · pyplots.ai' + - Realistic temperature/humidity scenario with sensible data ranges + weaknesses: + - Scatter point alpha could be slightly lower (0.2) for better contour visibility + in dense areas