From 9a61166ce887e5358311df411a33975cfa7d0f1d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 11:23:58 +0000 Subject: [PATCH 1/3] feat(letsplot): implement bar-categorical --- .../implementations/letsplot.py | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 plots/bar-categorical/implementations/letsplot.py diff --git a/plots/bar-categorical/implementations/letsplot.py b/plots/bar-categorical/implementations/letsplot.py new file mode 100644 index 0000000000..fd5f81cea9 --- /dev/null +++ b/plots/bar-categorical/implementations/letsplot.py @@ -0,0 +1,44 @@ +"""pyplots.ai +bar-categorical: Categorical Count Bar Chart +Library: lets-plot | Python 3.13 +Quality: pending | Created: 2025-12-30 +""" + +import numpy as np +import pandas as pd +from lets_plot import * # noqa: F403 +from lets_plot.export import ggsave as export_ggsave + + +LetsPlot.setup_html() # noqa: F405 + +# Data - raw categorical values (counts computed automatically by geom_bar) +np.random.seed(42) +categories = ["Apples", "Bananas", "Oranges", "Grapes", "Mangoes"] +weights = [0.25, 0.20, 0.22, 0.18, 0.15] +n_samples = 200 + +df = pd.DataFrame({"fruit": np.random.choice(categories, size=n_samples, p=weights)}) + +# Plot - geom_bar computes counts automatically (no stat='identity') +plot = ( + ggplot(df, aes(x="fruit")) # noqa: F405 + + geom_bar(fill="#306998", color="#1a3a54", size=0.5, alpha=0.9) # noqa: F405 + + labs( # noqa: F405 + x="Fruit Type", y="Count", title="bar-categorical · letsplot · pyplots.ai" + ) + + ggsize(1600, 900) # noqa: F405 + + theme_minimal() # noqa: F405 + + theme( # noqa: F405 + plot_title=element_text(size=24, face="bold"), # noqa: F405 + axis_title=element_text(size=20), # noqa: F405 + axis_text=element_text(size=16), # noqa: F405 + axis_text_x=element_text(angle=0), # noqa: F405 + panel_grid_major_x=element_blank(), # noqa: F405 + panel_grid_minor=element_blank(), # noqa: F405 + ) +) + +# Save as PNG (scale 3x for 4800x2700 px) and HTML +export_ggsave(plot, filename="plot.png", path=".", scale=3) +export_ggsave(plot, filename="plot.html", path=".") From 479acdf0ff2f6dc386e9c292b10bfa8cab1ae322 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 11:24:12 +0000 Subject: [PATCH 2/3] chore(letsplot): add metadata for bar-categorical --- plots/bar-categorical/metadata/letsplot.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plots/bar-categorical/metadata/letsplot.yaml diff --git a/plots/bar-categorical/metadata/letsplot.yaml b/plots/bar-categorical/metadata/letsplot.yaml new file mode 100644 index 0000000000..006ad8cde0 --- /dev/null +++ b/plots/bar-categorical/metadata/letsplot.yaml @@ -0,0 +1,19 @@ +# Per-library metadata for letsplot implementation of bar-categorical +# Auto-generated by impl-generate.yml + +library: letsplot +specification_id: bar-categorical +created: '2025-12-30T11:24:11Z' +updated: '2025-12-30T11:24:11Z' +generated_by: claude-opus-4-5-20251101 +workflow_run: 20595340647 +issue: 0 +python_version: 3.13.11 +library_version: 4.8.2 +preview_url: https://storage.googleapis.com/pyplots-images/plots/bar-categorical/letsplot/plot.png +preview_thumb: https://storage.googleapis.com/pyplots-images/plots/bar-categorical/letsplot/plot_thumb.png +preview_html: https://storage.googleapis.com/pyplots-images/plots/bar-categorical/letsplot/plot.html +quality_score: null +review: + strengths: [] + weaknesses: [] From aa53e6f1ba69c38538f588b1813de5748519d43f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 11:32:02 +0000 Subject: [PATCH 3/3] chore(letsplot): update quality score 91 and review feedback for bar-categorical --- .../implementations/letsplot.py | 6 +++--- plots/bar-categorical/metadata/letsplot.yaml | 20 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/plots/bar-categorical/implementations/letsplot.py b/plots/bar-categorical/implementations/letsplot.py index fd5f81cea9..49902de71f 100644 --- a/plots/bar-categorical/implementations/letsplot.py +++ b/plots/bar-categorical/implementations/letsplot.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai bar-categorical: Categorical Count Bar Chart -Library: lets-plot | Python 3.13 -Quality: pending | Created: 2025-12-30 +Library: letsplot 4.8.2 | Python 3.13.11 +Quality: 91/100 | Created: 2025-12-30 """ import numpy as np diff --git a/plots/bar-categorical/metadata/letsplot.yaml b/plots/bar-categorical/metadata/letsplot.yaml index 006ad8cde0..fb6c7d812e 100644 --- a/plots/bar-categorical/metadata/letsplot.yaml +++ b/plots/bar-categorical/metadata/letsplot.yaml @@ -1,10 +1,7 @@ -# Per-library metadata for letsplot implementation of bar-categorical -# Auto-generated by impl-generate.yml - library: letsplot specification_id: bar-categorical created: '2025-12-30T11:24:11Z' -updated: '2025-12-30T11:24:11Z' +updated: '2025-12-30T11:32:01Z' generated_by: claude-opus-4-5-20251101 workflow_run: 20595340647 issue: 0 @@ -13,7 +10,16 @@ library_version: 4.8.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/bar-categorical/letsplot/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/bar-categorical/letsplot/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/bar-categorical/letsplot/plot.html -quality_score: null +quality_score: 91 review: - strengths: [] - weaknesses: [] + strengths: + - Clean implementation following ggplot2 grammar of graphics + - Automatic count computation using geom_bar() without stat=identity + - Well-sized text elements (24pt title, 20pt axis labels, 16pt tick text) following + library guidelines + - Good use of theme_minimal() with appropriate grid customization + - Proper figure sizing (1600x900 with scale=3 for 4800x2700 output) + weaknesses: + - Does not leverage lets-plot interactive features (tooltips, hover effects) that + distinguish it from plotnine + - Data context is generic; could use a more specific real-world scenario