Skip to content

Commit ff6ddd8

Browse files
chore(plotnine): update quality score 86 and review feedback for line-retention-cohort
1 parent 2c41424 commit ff6ddd8

2 files changed

Lines changed: 216 additions & 10 deletions

File tree

plots/line-retention-cohort/implementations/plotnine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"""pyplots.ai
1+
""" pyplots.ai
22
line-retention-cohort: User Retention Curve by Cohort
3-
Library: plotnine | Python 3.13
4-
Quality: pending | Created: 2026-03-16
3+
Library: plotnine 0.15.3 | Python 3.14.3
4+
Quality: 86/100 | Created: 2026-03-16
55
"""
66

77
import numpy as np
Lines changed: 213 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
# Per-library metadata for plotnine implementation of line-retention-cohort
2-
# Auto-generated by impl-generate.yml
3-
41
library: plotnine
52
specification_id: line-retention-cohort
63
created: '2026-03-16T20:44:50Z'
7-
updated: '2026-03-16T20:44:50Z'
4+
updated: '2026-03-16T20:50:13Z'
85
generated_by: claude-opus-4-5-20251101
96
workflow_run: 23164943107
107
issue: 4572
@@ -13,7 +10,216 @@ library_version: 0.15.3
1310
preview_url: https://storage.googleapis.com/pyplots-images/plots/line-retention-cohort/plotnine/plot.png
1411
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/line-retention-cohort/plotnine/plot_thumb.png
1512
preview_html: null
16-
quality_score: null
13+
quality_score: 86
1714
review:
18-
strengths: []
19-
weaknesses: []
15+
strengths:
16+
- Full spec compliance with all required features implemented correctly
17+
- Thoughtful blue-to-orange color progression with alpha gradient creates effective
18+
temporal hierarchy
19+
- Clean well-structured code following KISS principles with proper reproducibility
20+
- Realistic product analytics data with appropriate cohort sizes and decay patterns
21+
weaknesses:
22+
- Oldest cohorts at alpha 0.45-0.55 are somewhat faint reducing readability
23+
- 20% threshold annotation is small (size=9) compared to other text elements
24+
- Design could be more polished with better typography hierarchy and annotation
25+
styling
26+
- Library mastery stays at basic grammar-of-graphics level without distinctive plotnine
27+
features
28+
image_description: The plot displays 5 retention curves for monthly signup cohorts
29+
(Jan-May 2025) over 12 weeks. Lines transition from light, transparent blue-gray
30+
(Jan 2025, oldest) to bold orange-red (May 2025, newest), creating a visual hierarchy
31+
emphasizing recent cohorts. All curves start at 100% at week 0 and decay exponentially,
32+
with newer cohorts retaining better. A dashed gray horizontal line marks the 20%
33+
retention threshold, with a small "20% threshold" annotation near the right end.
34+
The Y-axis shows "Retained Users" with percentage labels (0%-100%), X-axis shows
35+
"Weeks Since Signup" (0-12). Points mark each data value on the lines. A legend
36+
on the right lists each cohort with sample size (e.g., "Jan 2025 (n=1,245)").
37+
The title reads "line-retention-cohort · plotnine · pyplots.ai" in bold. Background
38+
is clean white with subtle horizontal gridlines.
39+
criteria_checklist:
40+
visual_quality:
41+
score: 28
42+
max: 30
43+
items:
44+
- id: VQ-01
45+
name: Text Legibility
46+
score: 7
47+
max: 8
48+
passed: true
49+
comment: All font sizes explicitly set. Threshold annotation at size=9 is
50+
small relative to other text.
51+
- id: VQ-02
52+
name: No Overlap
53+
score: 6
54+
max: 6
55+
passed: true
56+
comment: No overlapping text or elements. Legend well-separated from data.
57+
- id: VQ-03
58+
name: Element Visibility
59+
score: 5
60+
max: 6
61+
passed: true
62+
comment: Lines visible at size=1.5 with points. Oldest cohort at alpha=0.45
63+
is somewhat faint.
64+
- id: VQ-04
65+
name: Color Accessibility
66+
score: 4
67+
max: 4
68+
passed: true
69+
comment: Blue-to-orange palette is colorblind-safe with good contrast.
70+
- id: VQ-05
71+
name: Layout & Canvas
72+
score: 4
73+
max: 4
74+
passed: true
75+
comment: 16:9 ratio, plot fills canvas well, legend positioned cleanly.
76+
- id: VQ-06
77+
name: Axis Labels & Title
78+
score: 2
79+
max: 2
80+
passed: true
81+
comment: Descriptive labels with percentage units in tick labels.
82+
design_excellence:
83+
score: 13
84+
max: 20
85+
items:
86+
- id: DE-01
87+
name: Aesthetic Sophistication
88+
score: 5
89+
max: 8
90+
passed: true
91+
comment: Custom blue-to-orange palette with alpha gradient. Above defaults
92+
but not publication-quality.
93+
- id: DE-02
94+
name: Visual Refinement
95+
score: 4
96+
max: 6
97+
passed: true
98+
comment: Minimal theme, removed minor grid and x-grid. Subtle y-grid with
99+
alpha. Axis lines added.
100+
- id: DE-03
101+
name: Data Storytelling
102+
score: 4
103+
max: 6
104+
passed: true
105+
comment: Alpha and color progression create visual hierarchy. 20% threshold
106+
provides benchmark context.
107+
spec_compliance:
108+
score: 15
109+
max: 15
110+
items:
111+
- id: SC-01
112+
name: Plot Type
113+
score: 5
114+
max: 5
115+
passed: true
116+
comment: Correct line chart with multiple cohort curves.
117+
- id: SC-02
118+
name: Required Features
119+
score: 4
120+
max: 4
121+
passed: true
122+
comment: 'All spec features present: 100% start, distinct colors, legend with
123+
size, gridlines, opacity gradient, threshold line.'
124+
- id: SC-03
125+
name: Data Mapping
126+
score: 3
127+
max: 3
128+
passed: true
129+
comment: X = weeks since signup, Y = retention rate. All data visible.
130+
- id: SC-04
131+
name: Title & Legend
132+
score: 3
133+
max: 3
134+
passed: true
135+
comment: Title format correct. Legend labels match spec format.
136+
data_quality:
137+
score: 14
138+
max: 15
139+
items:
140+
- id: DQ-01
141+
name: Feature Coverage
142+
score: 5
143+
max: 6
144+
passed: true
145+
comment: 5 cohorts, 13 time periods, different decay rates. All curves follow
146+
similar exponential shape.
147+
- id: DQ-02
148+
name: Realistic Context
149+
score: 5
150+
max: 5
151+
passed: true
152+
comment: Monthly signup cohorts with realistic sizes. Neutral product analytics
153+
context.
154+
- id: DQ-03
155+
name: Appropriate Scale
156+
score: 4
157+
max: 4
158+
passed: true
159+
comment: Sensible retention values for SaaS product.
160+
code_quality:
161+
score: 10
162+
max: 10
163+
items:
164+
- id: CQ-01
165+
name: KISS Structure
166+
score: 3
167+
max: 3
168+
passed: true
169+
comment: 'Flat script: imports, data, plot, save.'
170+
- id: CQ-02
171+
name: Reproducibility
172+
score: 2
173+
max: 2
174+
passed: true
175+
comment: np.random.seed(42) set.
176+
- id: CQ-03
177+
name: Clean Imports
178+
score: 2
179+
max: 2
180+
passed: true
181+
comment: All imports used.
182+
- id: CQ-04
183+
name: Code Elegance
184+
score: 2
185+
max: 2
186+
passed: true
187+
comment: Clean, appropriate complexity. No fake UI.
188+
- id: CQ-05
189+
name: Output & API
190+
score: 1
191+
max: 1
192+
passed: true
193+
comment: Saves as plot.png with current API.
194+
library_mastery:
195+
score: 6
196+
max: 10
197+
items:
198+
- id: LM-01
199+
name: Idiomatic Usage
200+
score: 4
201+
max: 5
202+
passed: true
203+
comment: Good grammar of graphics usage with aes, geom layers, scales, themes.
204+
pd.Categorical and scale_alpha_identity are idiomatic.
205+
- id: LM-02
206+
name: Distinctive Features
207+
score: 2
208+
max: 5
209+
passed: false
210+
comment: Uses layer composition and scale_alpha_identity but lacks deeply
211+
distinctive plotnine features.
212+
verdict: REJECTED
213+
impl_tags:
214+
dependencies: []
215+
techniques:
216+
- annotations
217+
- layer-composition
218+
patterns:
219+
- data-generation
220+
- iteration-over-groups
221+
dataprep:
222+
- cumulative-sum
223+
styling:
224+
- alpha-blending
225+
- grid-styling

0 commit comments

Comments
 (0)