Skip to content

Commit 415cb62

Browse files
update(violin-basic): letsplot — comprehensive quality review
Comprehensive quality review improving code quality, data choice, visual design, spec compliance, and library feature usage.
1 parent e9894a3 commit 415cb62

2 files changed

Lines changed: 18 additions & 20 deletions

File tree

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" pyplots.ai
22
violin-basic: Basic Violin Plot
3-
Library: letsplot 4.8.1 | Python 3.13.11
4-
Quality: 91/100 | Created: 2025-12-23
3+
Library: letsplot 4.8.2 | Python 3.14.3
4+
Quality: /100 | Updated: 2026-02-21
55
"""
66

77
import numpy as np
@@ -16,9 +16,8 @@
1616
np.random.seed(42)
1717

1818
categories = ["Engineering", "Marketing", "Sales", "Design"]
19-
colors = ["#306998", "#FFD43B", "#4B8BBE", "#FFE873"]
19+
colors = ["#306998", "#E8A317", "#4B8BBE", "#2E8B57"]
2020

21-
# Generate realistic salary distributions per department
2221
data = []
2322
distributions = {
2423
"Engineering": {"mean": 95000, "std": 20000, "n": 200},
@@ -30,7 +29,7 @@
3029
for cat in categories:
3130
dist = distributions[cat]
3231
values = np.random.normal(dist["mean"], dist["std"], dist["n"])
33-
values = np.clip(values, 30000, 200000) # Realistic salary bounds
32+
values = np.clip(values, 30000, 200000)
3433
for v in values:
3534
data.append({"Department": cat, "Salary": v})
3635

@@ -40,28 +39,27 @@
4039
plot = (
4140
ggplot(df, aes(x="Department", y="Salary", fill="Department")) # noqa: F405
4241
+ geom_violin( # noqa: F405
43-
quantiles=[0.25, 0.5, 0.75], # Show quartiles including median
44-
quantile_lines=True, # Draw lines at quantiles
45-
size=1.5, # Border thickness
46-
alpha=0.8,
47-
trim=False, # Show full tails
42+
quantiles=[0.25, 0.5, 0.75], quantile_lines=True, size=1.2, alpha=0.85, trim=False, color="#2C3E50"
4843
)
4944
+ scale_fill_manual(values=colors) # noqa: F405
45+
+ scale_y_continuous( # noqa: F405
46+
format="${,.0f}"
47+
)
5048
+ labs( # noqa: F405
51-
x="Department", y="Salary ($)", title="violin-basic · lets-plot · pyplots.ai"
49+
x="Department", y="Salary", title="violin-basic \u00b7 letsplot \u00b7 pyplots.ai"
5250
)
5351
+ theme_minimal() # noqa: F405
5452
+ theme( # noqa: F405
5553
axis_title=element_text(size=20), # noqa: F405
5654
axis_text=element_text(size=16), # noqa: F405
5755
plot_title=element_text(size=24), # noqa: F405
58-
legend_position="none", # Legend not needed, x-axis shows categories
56+
legend_position="none",
57+
panel_grid_major_x=element_blank(), # noqa: F405
58+
axis_ticks=element_blank(), # noqa: F405
5959
)
6060
+ ggsize(1600, 900) # noqa: F405
6161
)
6262

63-
# Save PNG (scale 3x to get 4800 × 2700 px)
63+
# Save
6464
export_ggsave(plot, filename="plot.png", path=".", scale=3)
65-
66-
# Save HTML for interactive version
6765
export_ggsave(plot, filename="plot.html", path=".")

plots/violin-basic/metadata/letsplot.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
library: letsplot
22
specification_id: violin-basic
33
created: '2025-12-23T00:36:17Z'
4-
updated: '2025-12-23T00:39:43Z'
5-
generated_by: claude-opus-4-5-20251101
4+
updated: '2026-02-21T22:25:00+00:00'
5+
generated_by: claude-opus-4-6
66
workflow_run: 20447783845
77
issue: 0
8-
python_version: 3.13.11
9-
library_version: 4.8.1
8+
python_version: '3.14.3'
9+
library_version: '4.8.2'
1010
preview_url: https://storage.googleapis.com/pyplots-images/plots/violin-basic/letsplot/plot.png
1111
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/violin-basic/letsplot/plot_thumb.png
1212
preview_html: https://storage.googleapis.com/pyplots-images/plots/violin-basic/letsplot/plot.html
13-
quality_score: 91
13+
quality_score: null
1414
impl_tags:
1515
dependencies: []
1616
techniques:

0 commit comments

Comments
 (0)