Skip to content

Commit b4771fb

Browse files
chore(seaborn): update quality score 87 and review feedback for line-retention-cohort
1 parent b0950bb commit b4771fb

2 files changed

Lines changed: 68 additions & 69 deletions

File tree

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

Lines changed: 2 additions & 2 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
33
Library: seaborn 0.13.2 | Python 3.14.3
4-
Quality: 84/100 | Created: 2026-03-16
4+
Quality: 87/100 | Created: 2026-03-16
55
"""
66

77
import matplotlib.pyplot as plt
Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
library: seaborn
22
specification_id: line-retention-cohort
33
created: '2026-03-16T20:44:49Z'
4-
updated: '2026-03-16T20:49:30Z'
4+
updated: '2026-03-16T20:59:56Z'
55
generated_by: claude-opus-4-5-20251101
66
workflow_run: 23164943129
77
issue: 4572
@@ -10,76 +10,76 @@ library_version: 0.13.2
1010
preview_url: https://storage.googleapis.com/pyplots-images/plots/line-retention-cohort/seaborn/plot.png
1111
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/line-retention-cohort/seaborn/plot_thumb.png
1212
preview_html: null
13-
quality_score: 84
13+
quality_score: 87
1414
review:
1515
strengths:
16-
- Perfect spec compliance with all required features including 20% reference line
17-
and legend with cohort sizes
18-
- Effective visual hierarchy through line weight and color saturation progression
19-
emphasizing newer cohorts
20-
- Clean well-structured code with proper seed and explicit font sizing
21-
- Good data storytelling with immediately apparent improving retention trend
16+
- All spec requirements fully implemented including progressive emphasis and 20%
17+
reference line
18+
- Colorblind-accessible palette with distinct marker shapes per cohort
19+
- Clean, well-structured data generation with realistic exponential decay model
20+
and floor values
21+
- Excellent spec compliance — perfect 15/15
2222
weaknesses:
23-
- Color palette has insufficient contrast between similar-hue pairs (Jan/Feb grays,
24-
Apr/May greens) for colorblind users
25-
- Library mastery is low - manual iteration over groups rather than using seaborn
26-
hue-based grouping
27-
- No distinctive seaborn features leveraged - all styling is matplotlib
28-
image_description: The plot shows a line chart with 5 retention curves, one per
29-
monthly signup cohort (Jan-May 2025). All curves start at 100% at week 0 and decay
30-
over 12 weeks. Older cohorts (Jan, Feb) use lighter gray/blue tones with thinner
31-
lines, while newer cohorts (Apr, May) use darker green tones with thicker lines
32-
and larger markers. The x-axis is labeled "Weeks Since Signup" (0-12), and the
33-
y-axis is "Retained Users (%)" (0-100%). A dashed gray horizontal line marks the
34-
20% retention target. The legend in the upper right, titled "Signup Cohort," shows
35-
each cohort label with its sample size (e.g., "Jan 2025 (n=1,245)"). Top and right
36-
spines are removed, with a subtle y-axis grid. The title reads "line-retention-cohort
37-
· seaborn · pyplots.ai".
23+
- Design sophistication could be elevated toward publication quality (DE-01=5)
24+
- Could add endpoint value annotations to strengthen data storytelling (DE-03=4)
25+
- Library mastery could leverage more seaborn-distinctive features (LM-02=3)
26+
image_description: 'The plot displays 5 user retention curves for monthly signup
27+
cohorts (Jan–May 2025) over 12 weeks. Each curve starts at 100% at week 0 and
28+
decays at different rates. Colors are from seaborn''s colorblind palette: blue
29+
(Jan 2025, circles), orange (Feb 2025, X markers), green (Mar 2025, squares),
30+
red-orange (Apr 2025, plus signs), and pink/purple (May 2025, diamonds). Lines
31+
have progressive linewidth and opacity — older cohorts are thinner and more transparent,
32+
newer ones are bolder. Jan 2025 decays fastest to ~20% by week 12, while May 2025
33+
retains best at ~53%. A dashed gray horizontal reference line at 20% is labeled
34+
"20% target" in italic at the right edge. Title: "line-retention-cohort · seaborn
35+
· pyplots.ai" at top center. Y-axis: "Retained Users (%)" ranging 0–105. X-axis:
36+
"Weeks Since Signup" with ticks 0–12. Top and right spines are removed. Subtle
37+
y-axis-only gridlines at low alpha. Legend in upper right titled "Signup Cohort"
38+
(semibold) lists all 5 cohorts with sample sizes.'
3839
criteria_checklist:
3940
visual_quality:
4041
score: 28
4142
max: 30
4243
items:
4344
- id: VQ-01
4445
name: Text Legibility
45-
score: 8
46+
score: 7
4647
max: 8
4748
passed: true
48-
comment: 'All font sizes explicitly set: title 24pt, labels 20pt, ticks 16pt,
49-
legend 14pt'
49+
comment: All major font sizes explicitly set. The 20% target annotation at
50+
13pt is slightly small.
5051
- id: VQ-02
5152
name: No Overlap
5253
score: 6
5354
max: 6
5455
passed: true
55-
comment: No overlapping text or elements
56+
comment: No text collisions. Lines converge at week 0 but remain distinguishable.
5657
- id: VQ-03
5758
name: Element Visibility
5859
score: 5
5960
max: 6
6061
passed: true
61-
comment: Lines and markers clearly visible; Apr/May green lines close in hue
62-
though distinguishable by thickness
62+
comment: Distinct marker shapes via style parameter. Progressive linewidth
63+
helps distinguish cohorts.
6364
- id: VQ-04
6465
name: Color Accessibility
65-
score: 3
66+
score: 4
6667
max: 4
6768
passed: true
68-
comment: Blue-to-green palette mostly distinguishable but Jan/Feb and Apr/May
69-
pairs are close for colorblind users
69+
comment: Uses seaborn colorblind palette. Excellent accessibility.
7070
- id: VQ-05
7171
name: Layout & Canvas
7272
score: 4
7373
max: 4
7474
passed: true
75-
comment: Good use of 16:9 canvas with tight_layout and balanced margins
75+
comment: 16x9 figure with tight_layout. Plot fills canvas well.
7676
- id: VQ-06
7777
name: Axis Labels & Title
7878
score: 2
7979
max: 2
8080
passed: true
81-
comment: 'Descriptive labels with units: Weeks Since Signup, Retained Users
82-
(%)'
81+
comment: 'Descriptive labels with units: Retained Users (%) and Weeks Since
82+
Signup.'
8383
design_excellence:
8484
score: 13
8585
max: 20
@@ -89,21 +89,22 @@ review:
8989
score: 5
9090
max: 8
9191
passed: true
92-
comment: Thoughtful palette progression with increasing linewidths and marker
93-
sizes, above defaults but not publication-showcase
92+
comment: Above configured defaults with progressive emphasis and reference
93+
line, but not yet publication-ready.
9494
- id: DE-02
9595
name: Visual Refinement
9696
score: 4
9797
max: 6
9898
passed: true
99-
comment: Spines removed, subtle y-axis grid, frameless legend, generous whitespace
99+
comment: Spines removed, y-only grid at alpha=0.15, generous whitespace. Good
100+
refinement.
100101
- id: DE-03
101102
name: Data Storytelling
102103
score: 4
103104
max: 6
104105
passed: true
105-
comment: Clear visual hierarchy through line weight and color saturation;
106-
20% target adds context
106+
comment: Progressive emphasis creates hierarchy. 20% target adds benchmark
107+
context. Could add endpoint annotations.
107108
spec_compliance:
108109
score: 15
109110
max: 15
@@ -113,27 +114,26 @@ review:
113114
score: 5
114115
max: 5
115116
passed: true
116-
comment: Correct line chart with retention curves
117+
comment: Line chart with multiple cohort curves. Correct.
117118
- id: SC-02
118119
name: Required Features
119120
score: 4
120121
max: 4
121122
passed: true
122-
comment: 'All features present: 100% start, distinct colors, legend with sizes,
123-
gridlines, reference line'
123+
comment: 'All spec features present: 100% start, distinct colors, legend with
124+
sizes, reference line, progressive emphasis.'
124125
- id: SC-03
125126
name: Data Mapping
126127
score: 3
127128
max: 3
128129
passed: true
129-
comment: X=weeks since signup, Y=retention percentage, correctly mapped
130+
comment: X=weeks, Y=retention%, hue=cohort. All correct.
130131
- id: SC-04
131132
name: Title & Legend
132133
score: 3
133134
max: 3
134135
passed: true
135-
comment: Correct title format and legend labels with cohort names and sample
136-
sizes
136+
comment: Title follows spec format. Legend labels use cohort (n=size) format.
137137
data_quality:
138138
score: 14
139139
max: 15
@@ -143,22 +143,21 @@ review:
143143
score: 5
144144
max: 6
145145
passed: true
146-
comment: 5 cohorts with 13 time periods each, good variation in decay rates
147-
and floor values
146+
comment: 5 cohorts with distinct decay rates and floor values. Good variation
147+
with noise.
148148
- id: DQ-02
149149
name: Realistic Context
150150
score: 5
151151
max: 5
152152
passed: true
153-
comment: Monthly user signup cohorts tracked for retention - classic product
154-
analytics scenario
153+
comment: Monthly SaaS signup cohorts tracked weekly. Realistic, neutral business
154+
scenario.
155155
- id: DQ-03
156156
name: Appropriate Scale
157157
score: 4
158158
max: 4
159159
passed: true
160-
comment: Retention 100% to 20-50% over 12 weeks is realistic; cohort sizes
161-
1,245-1,605 are plausible
160+
comment: Cohort sizes 1245-1605, retention 100% to 20-53%. Realistic values.
162161
code_quality:
163162
score: 10
164163
max: 10
@@ -168,49 +167,49 @@ review:
168167
score: 3
169168
max: 3
170169
passed: true
171-
comment: Clean Imports-Data-Plot-Style-Save flow, no functions or classes
170+
comment: Flat script structure. No functions/classes.
172171
- id: CQ-02
173172
name: Reproducibility
174173
score: 2
175174
max: 2
176175
passed: true
177-
comment: np.random.seed(42) set
176+
comment: np.random.seed(42) set.
178177
- id: CQ-03
179178
name: Clean Imports
180179
score: 2
181180
max: 2
182181
passed: true
183-
comment: 'All imports used: plt, np, pd, sns'
182+
comment: All imports used.
184183
- id: CQ-04
185184
name: Code Elegance
186185
score: 2
187186
max: 2
188187
passed: true
189-
comment: Well-structured, appropriate complexity
188+
comment: Clean, Pythonic, appropriate complexity. No fake UI.
190189
- id: CQ-05
191190
name: Output & API
192191
score: 1
193192
max: 1
194193
passed: true
195-
comment: Saves as plot.png with dpi=300, bbox_inches=tight
194+
comment: Saves as plot.png, dpi=300, current API.
196195
library_mastery:
197-
score: 4
196+
score: 7
198197
max: 10
199198
items:
200199
- id: LM-01
201200
name: Idiomatic Usage
202-
score: 3
201+
score: 4
203202
max: 5
204-
passed: false
205-
comment: Uses sns.lineplot but iterates manually over groups instead of using
206-
hue parameter
203+
passed: true
204+
comment: Uses sns.lineplot with hue/style, sns.set_theme, sns.set_context,
205+
axes-level API.
207206
- id: LM-02
208207
name: Distinctive Features
209-
score: 1
208+
score: 3
210209
max: 5
211-
passed: false
212-
comment: All customization via matplotlib; plot could be replicated with pure
213-
matplotlib
210+
passed: true
211+
comment: style parameter for marker differentiation, sns.set_theme rc dict,
212+
colorblind palette. Some distinctive usage.
214213
verdict: REJECTED
215214
impl_tags:
216215
dependencies: []
@@ -220,7 +219,7 @@ impl_tags:
220219
patterns:
221220
- data-generation
222221
- iteration-over-groups
223-
- explicit-figure
224222
dataprep: []
225223
styling:
226224
- grid-styling
225+
- alpha-blending

0 commit comments

Comments
 (0)