Skip to content

Commit 262c795

Browse files
update(area-basic): letsplot — comprehensive quality review
Switched to datetime x-axis, added interactive tooltips, scale_y_continuous, subtler grid
1 parent ed0fb1b commit 262c795

2 files changed

Lines changed: 21 additions & 13 deletions

File tree

plots/area-basic/implementations/letsplot.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
""" pyplots.ai
1+
"""pyplots.ai
22
area-basic: Basic Area Chart
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.2
4+
Quality: /100 | Updated: 2026-02-11
55
"""
66

77
import numpy as np
@@ -23,23 +23,31 @@
2323
visitors = np.clip(visitors, 2000, None).astype(int)
2424

2525
df = pd.DataFrame({"date": days, "visitors": visitors})
26-
df["day_num"] = np.arange(1, len(df) + 1)
2726

2827
# Plot
2928
plot = (
30-
ggplot(df, aes(x="day_num", y="visitors")) # noqa: F405
31-
+ geom_area(fill="#306998", alpha=0.4) # noqa: F405
29+
ggplot(df, aes(x="date", y="visitors")) # noqa: F405
30+
+ geom_area( # noqa: F405
31+
fill="#306998",
32+
alpha=0.4,
33+
tooltips=layer_tooltips() # noqa: F405
34+
.line("@visitors visitors")
35+
.format("date", "%b %d, %Y")
36+
.line("@date"),
37+
)
3238
+ geom_line(color="#306998", size=2) # noqa: F405
39+
+ scale_x_datetime(format="%b %d") # noqa: F405
40+
+ scale_y_continuous(limits=[0, None]) # noqa: F405
3341
+ labs( # noqa: F405
34-
x="Day of Month", y="Daily Visitors", title="area-basic · letsplot · pyplots.ai"
42+
x="Date", y="Daily Visitors", title="area-basic · letsplot · pyplots.ai"
3543
)
3644
+ ggsize(1600, 900) # noqa: F405
3745
+ theme_minimal() # noqa: F405
3846
+ theme( # noqa: F405
3947
axis_text=element_text(size=16), # noqa: F405
4048
axis_title=element_text(size=20), # noqa: F405
4149
plot_title=element_text(size=24), # noqa: F405
42-
panel_grid=element_line(color="#CCCCCC", size=0.5, linetype="dashed"), # noqa: F405
50+
panel_grid=element_line(color="#CCCCCC", size=0.3, linetype="dashed"), # noqa: F405
4351
)
4452
)
4553

plots/area-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: area-basic
33
created: '2025-12-23T00:49:34Z'
4-
updated: '2025-12-23T01:21:34Z'
5-
generated_by: claude-opus-4-5-20251101
4+
updated: '2026-02-11T22:20:05+00:00'
5+
generated_by: claude-opus-4-6
66
workflow_run: 20447993117
77
issue: 0
8-
python_version: 3.13.11
9-
library_version: 4.8.1
8+
python_version: 3.14.2
9+
library_version: 4.8.2
1010
preview_url: https://storage.googleapis.com/pyplots-images/plots/area-basic/letsplot/plot.png
1111
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/area-basic/letsplot/plot_thumb.png
1212
preview_html: https://storage.googleapis.com/pyplots-images/plots/area-basic/letsplot/plot.html
13-
quality_score: 91
13+
quality_score: null
1414
impl_tags:
1515
dependencies: []
1616
techniques:

0 commit comments

Comments
 (0)