Skip to content

Commit 5c1c5db

Browse files
Merge remote-tracking branch 'origin/main'
2 parents 3b51f66 + 112a383 commit 5c1c5db

2 files changed

Lines changed: 108 additions & 96 deletions

File tree

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
""" anyplot.ai
22
scatter-basic: Basic Scatter Plot
33
Library: matplotlib 3.10.8 | Python 3.14.4
4-
Quality: 85/100 | Created: 2026-04-23
4+
Quality: 86/100 | Updated: 2026-04-23
55
"""
66

77
import os
88

9+
import matplotlib as mpl
910
import matplotlib.pyplot as plt
1011
import numpy as np
1112

@@ -15,9 +16,15 @@
1516
PAGE_BG = "#FAF8F1" if THEME == "light" else "#1A1A17"
1617
INK = "#1A1A17" if THEME == "light" else "#F0EFE8"
1718
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
19+
INK_MUTED = "#6B6A63" if THEME == "light" else "#A8A79F"
1820
BRAND = "#009E73" # Okabe-Ito position 1
1921

20-
# Data — study hours vs exam scores (neutral educational context, r ~ 0.7)
22+
# Global typography via rcParams (matplotlib-native styling)
23+
mpl.rcParams.update(
24+
{"font.family": "DejaVu Sans", "axes.titlepad": 22, "axes.labelpad": 14, "axes.unicode_minus": True}
25+
)
26+
27+
# Data — study hours vs exam scores (r ~ 0.7)
2128
np.random.seed(42)
2229
study_hours = np.random.uniform(1, 12, 180)
2330
exam_scores = np.clip(38 + study_hours * 4.5 + np.random.normal(0, 6.5, 180), 35, 100)
@@ -26,21 +33,35 @@
2633
fig, ax = plt.subplots(figsize=(16, 9), facecolor=PAGE_BG)
2734
ax.set_facecolor(PAGE_BG)
2835

29-
ax.scatter(study_hours, exam_scores, s=140, alpha=0.7, color=BRAND, edgecolors=PAGE_BG, linewidths=0.8)
36+
ax.scatter(study_hours, exam_scores, s=95, alpha=0.65, color=BRAND, edgecolors=PAGE_BG, linewidths=0.7)
3037

3138
# Style
32-
ax.set_xlabel("Study Hours per Week", fontsize=20, color=INK)
33-
ax.set_ylabel("Exam Score (%)", fontsize=20, color=INK)
34-
ax.set_title("scatter-basic · matplotlib · anyplot.ai", fontsize=24, fontweight="medium", color=INK, pad=18)
35-
ax.tick_params(axis="both", labelsize=16, colors=INK_SOFT)
39+
ax.set_xlabel("Study Hours per Week", fontsize=20, color=INK, fontweight="regular")
40+
ax.set_ylabel("Exam Score (%)", fontsize=20, color=INK, fontweight="regular")
41+
ax.set_title("scatter-basic · matplotlib · anyplot.ai", fontsize=24, fontweight="medium", color=INK)
42+
43+
ax.tick_params(axis="both", which="both", labelsize=16, colors=INK_SOFT, length=0, pad=10)
3644
ax.spines["top"].set_visible(False)
3745
ax.spines["right"].set_visible(False)
3846
for spine in ("left", "bottom"):
3947
ax.spines[spine].set_color(INK_SOFT)
48+
ax.spines[spine].set_linewidth(0.8)
49+
4050
ax.grid(True, alpha=0.10, linewidth=0.8, color=INK)
4151
ax.set_axisbelow(True)
42-
ax.set_xlim(0, 13)
43-
ax.set_ylim(30, 105)
52+
ax.margins(x=0.04, y=0.08)
53+
54+
# Tertiary metadata footnote (n + Pearson r)
55+
r = np.corrcoef(study_hours, exam_scores)[0, 1]
56+
fig.text(
57+
0.985,
58+
0.015,
59+
f"n = {len(study_hours)} · Pearson r = {r:.2f}",
60+
fontsize=13,
61+
color=INK_MUTED,
62+
ha="right",
63+
va="bottom",
64+
)
4465

45-
plt.tight_layout()
66+
plt.tight_layout(rect=(0, 0.03, 1, 1))
4667
plt.savefig(f"plot-{THEME}.png", dpi=300, bbox_inches="tight", facecolor=PAGE_BG)

plots/scatter-basic/metadata/python/matplotlib.yaml

Lines changed: 77 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,51 @@ library: matplotlib
22
language: python
33
specification_id: scatter-basic
44
created: '2025-12-10T20:55:10Z'
5-
updated: '2026-04-23T19:19:17Z'
5+
updated: '2026-04-23T21:32:57Z'
66
generated_by: claude-opus
7-
workflow_run: 24853797063
7+
workflow_run: 24859480936
88
issue: 611
99
python_version: 3.14.4
1010
library_version: 3.10.8
1111
preview_url_light: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/matplotlib/plot-light.png
1212
preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/matplotlib/plot-dark.png
1313
preview_html_light: null
1414
preview_html_dark: null
15-
quality_score: 85
15+
quality_score: 86
1616
review:
1717
strengths:
18-
- Perfect theme-adaptive chrome — both light (#FAF8F1) and dark (#1A1A17) renders
19-
apply INK/INK_SOFT tokens to all chrome elements; no dark-on-dark or light-on-light
20-
failures
21-
- 'Fully spec-compliant data: 180 points, r~0.7 positive correlation, alpha=0.7
22-
transparency, descriptive axis labels with units, correct title format'
23-
- Clean, reproducible code — KISS structure, seed(42), Axes-method usage (ax.scatter
24-
not plt.scatter), set_axisbelow(True) keeps grid under data
25-
- 'Good visual hygiene: L-shaped spine frame, background-colored marker edges (edgecolors=PAGE_BG)
26-
for clean point separation, subtle grid at alpha=0.10'
18+
- 'Perfect theme adaptation: both light and dark renders pass readability check;
19+
background, text, grid, and spine colors all flip correctly using the token pattern'
20+
- All font sizes explicitly set at recommended values (24/20/16); zero legibility
21+
issues in either theme
22+
- Informative Pearson r footnote adds interpretive value beyond a plain scatter
23+
- Thematic edgecolors=PAGE_BG is a nice technique that gives scatter points subtle
24+
definition without visual noise
25+
- 'Perfect code quality: flat KISS structure, seed set, clean imports, correct output
26+
filenames'
27+
- 'Full spec compliance: title format, axis labels with units, alpha transparency,
28+
grid lines'
2729
weaknesses:
28-
- 'DE-01 (4/8): No aesthetic differentiation beyond correct defaults — typography
29-
is unstyled, no intentional visual hierarchy, no design flair above a well-configured
30-
library output'
31-
- 'DE-03 (2/6): The positive correlation story is fully visible in the data but
32-
nothing emphasises it — no trend line, no performance-group colouring, no annotation
33-
of notable outliers; viewer must extract the insight unaided'
34-
- 'DE-02 (4/6): Tick marks still visible; no letter-spacing or padding tweaks; could
35-
remove tick marks (ax.tick_params(length=0)) and add generous ax.margins() for
36-
a more polished look'
37-
- 'LM-02 (2/5): Only set_axisbelow and edgecolors use matplotlib-specific capabilities;
38-
no use of PathCollection transforms, rcParams-based style, or other distinctively
39-
matplotlib techniques'
40-
- 'VQ-03 (5/6): s=140 exceeds the recommended s=50-100 for 180 points, causing noticeable
41-
crowding in the 1-3 hour cluster; reduce to s=90-110 and tighten alpha slightly'
30+
- Correlation r=0.92 is substantially higher than the spec's 'moderate r~0.7' —
31+
increase noise sigma from 6.5 to ~12 so the scatter demonstrates typical uncertainty
32+
rather than near-linear determinism
33+
- 'No visual hierarchy or emphasis (DE-03): all points identical size/color; consider
34+
adding a trend line (np.polyfit/np.poly1d) or using color/size variation to create
35+
a focal point that guides the viewer'
36+
- Marker size s=95 is functional but at the lower bound of the recommended 50-100
37+
range for 180 points; s=120-150 would read better at full resolution
4238
image_description: |-
4339
Light render (plot-light.png):
44-
Background: Warm off-white matching #FAF8F1 — correct, not pure white.
45-
Chrome: Title "scatter-basic · matplotlib · anyplot.ai" in dark ink, clearly readable. X-axis label "Study Hours per Week" and Y-axis label "Exam Score (%)" in dark text, both readable. Tick labels in dark gray (INK_SOFT), clearly readable against the light surface. L-shaped spine frame (top/right removed). Subtle gridlines on both axes, alpha ~0.10.
46-
Data: ~180 teal-green (#009E73) scatter markers with alpha=0.7 and background-colored edges. Clear positive correlation visible from lower-left to upper-right. Moderate crowding in the 1–3 hour range.
47-
Legibility verdict: PASS — all text clearly readable against light background; no light-on-light issues.
40+
Background: Warm off-white #FAF8F1 — correct, not pure white
41+
Chrome: Title "scatter-basic · matplotlib · anyplot.ai" in dark ink, fontsize 24, clearly readable. Axis labels "Study Hours per Week" and "Exam Score (%)" in dark ink, fontsize 20, fully legible. Tick labels at fontsize 16 in muted dark tone, clearly readable. Subtle bi-axial grid at alpha=0.10. Top/right spines removed. Footnote "n = 180 · Pearson r = 0.92" in tertiary muted text, readable.
42+
Data: 180 scatter points in brand green #009E73 with alpha=0.65. Positive upward trend clearly visible. Edge colors match PAGE_BG for subtle definition.
43+
Legibility verdict: PASS
4844
4945
Dark render (plot-dark.png):
50-
Background: Warm near-black matching #1A1A17 — correct, not pure black.
51-
Chrome: Title, axis labels, and tick labels all rendered in light colors (INK/INK_SOFT tokens), clearly readable against the dark surface. No dark-on-dark failures observed. Gridlines subtle, visible. Same L-shaped spine structure.
52-
Data: Teal-green (#009E73) markers are identical in color to the light render — only chrome elements have flipped. Markers are clearly distinguishable against the dark background.
53-
Legibility verdict: PASS — all text clearly readable against dark background; no dark-on-dark issues; brand green #009E73 remains fully visible.
46+
Background: Warm near-black #1A1A17 — correct, not pure black
47+
Chrome: Title, axis labels, tick labels all in light #F0EFE8/#B8B7B0 tones against dark surface — all clearly readable. No dark-on-dark failures detected. Grid lines subtle and visible. Footnote in muted light text, visible.
48+
Data: Brand green #009E73 scatter points — identical to light render. Okabe-Ito data colors unchanged between themes.
49+
Legibility verdict: PASS
5450
criteria_checklist:
5551
visual_quality:
5652
score: 29
@@ -61,72 +57,71 @@ review:
6157
score: 8
6258
max: 8
6359
passed: true
64-
comment: 'All font sizes explicitly set: title=24, labels=20, ticks=16; readable
65-
in both themes'
60+
comment: Title 24pt, labels 20pt, ticks 16pt all explicitly set; readable
61+
in both themes
6662
- id: VQ-02
6763
name: No Overlap
6864
score: 6
6965
max: 6
7066
passed: true
71-
comment: No text overlap; marker overlap is natural and handled by alpha=0.7
67+
comment: No text overlaps; alpha=0.65 handles point density
7268
- id: VQ-03
7369
name: Element Visibility
7470
score: 5
7571
max: 6
7672
passed: true
77-
comment: s=140 slightly above recommended s=50-100 for 180 points; causes
78-
crowding in 1-3h cluster but still readable
73+
comment: s=95 with 180 points at lower end of 50-100 recommended range; visible
74+
but could be slightly larger
7975
- id: VQ-04
8076
name: Color Accessibility
8177
score: 2
8278
max: 2
8379
passed: true
84-
comment: 'Single-series #009E73 on both backgrounds; CVD-safe Okabe-Ito color'
80+
comment: Single brand green series; CVD-safe by design
8581
- id: VQ-05
8682
name: Layout & Canvas
8783
score: 4
8884
max: 4
8985
passed: true
90-
comment: 16:9 canvas well utilized; balanced margins; tight_layout applied
86+
comment: Good 16:9 proportions, generous margins, nothing cut off
9187
- id: VQ-06
9288
name: Axis Labels & Title
9389
score: 2
9490
max: 2
9591
passed: true
96-
comment: 'X: ''Study Hours per Week'', Y: ''Exam Score (%)'' with unit; title
97-
format correct'
92+
comment: Exam Score (%) and Study Hours per Week include units
9893
- id: VQ-07
9994
name: Palette Compliance
10095
score: 2
10196
max: 2
10297
passed: true
103-
comment: 'First series = #009E73; backgrounds #FAF8F1/#1A1A17; INK/INK_SOFT
104-
tokens applied correctly in both renders'
98+
comment: 'First series #009E73; backgrounds #FAF8F1/#1A1A17; chrome flips
99+
correctly'
105100
design_excellence:
106-
score: 10
101+
score: 12
107102
max: 20
108103
items:
109104
- id: DE-01
110105
name: Aesthetic Sophistication
111-
score: 4
106+
score: 5
112107
max: 8
113-
passed: false
114-
comment: Well-configured default look; correct theming and palette but no
115-
distinctive typography, hierarchy, or design flair
108+
passed: true
109+
comment: 'Above well-configured default: brand green, thematic edgecolors=PAGE_BG,
110+
rcParams typography, Pearson r footnote. Not yet strong design level.'
116111
- id: DE-02
117112
name: Visual Refinement
118113
score: 4
119114
max: 6
120-
passed: false
121-
comment: Grid adjusted, spines removed, set_axisbelow; tick marks still present;
122-
no padding/margin polish
115+
passed: true
116+
comment: Spines removed, grid alpha=0.10, tick length=0, spine linewidth=0.8,
117+
set_axisbelow(True). Clear refinement above default.
123118
- id: DE-03
124119
name: Data Storytelling
125-
score: 2
120+
score: 3
126121
max: 6
127122
passed: false
128-
comment: Correlation is visible in data but not emphasised; no trend line,
129-
grouping, or focal point; viewer must extract insight unaided
123+
comment: 'Pearson r footnote adds context above default, but no visual hierarchy:
124+
all points same size/color, no trend line, no focal emphasis'
130125
spec_compliance:
131126
score: 15
132127
max: 15
@@ -136,52 +131,49 @@ review:
136131
score: 5
137132
max: 5
138133
passed: true
139-
comment: Correct scatter plot type
134+
comment: Correct scatter plot
140135
- id: SC-02
141136
name: Required Features
142137
score: 4
143138
max: 4
144139
passed: true
145-
comment: Alpha=0.7, axis labels, title, grid lines all present
140+
comment: alpha=0.65, axis labels with units, title, grid lines all present
146141
- id: SC-03
147142
name: Data Mapping
148143
score: 3
149144
max: 3
150145
passed: true
151-
comment: X=study hours (independent), Y=exam score (dependent); 180 points;
152-
r~0.7 correlation
146+
comment: Study hours on x, exam scores on y; all 180 points visible
153147
- id: SC-04
154148
name: Title & Legend
155149
score: 3
156150
max: 3
157151
passed: true
158-
comment: Title 'scatter-basic · matplotlib · anyplot.ai' correct; single-series
159-
so no legend needed
152+
comment: Title is exactly 'scatter-basic · matplotlib · anyplot.ai'; single
153+
series, no legend needed
160154
data_quality:
161-
score: 15
155+
score: 13
162156
max: 15
163157
items:
164158
- id: DQ-01
165159
name: Feature Coverage
166-
score: 6
160+
score: 4
167161
max: 6
168-
passed: true
169-
comment: Demonstrates correlation, scatter/noise, density variation, natural
170-
spread across range
162+
passed: false
163+
comment: r=0.92 considerably stronger than spec's moderate r~0.7; relationship
164+
appears near-deterministic rather than showing typical scatter uncertainty
171165
- id: DQ-02
172166
name: Realistic Context
173167
score: 5
174168
max: 5
175169
passed: true
176-
comment: Study hours vs exam scores — neutral educational scenario matching
177-
spec examples; plausible values
170+
comment: 'Study hours vs exam scores: classic neutral educational example'
178171
- id: DQ-03
179172
name: Appropriate Scale
180173
score: 4
181174
max: 4
182175
passed: true
183-
comment: Hours 1-12/week and scores 35-100% are realistic; linear relationship
184-
with noise is physically sensible
176+
comment: Study hours 1-12/week and exam scores 35-100% perfectly realistic
185177
code_quality:
186178
score: 10
187179
max: 10
@@ -191,51 +183,51 @@ review:
191183
score: 3
192184
max: 3
193185
passed: true
194-
comment: 'Linear: imports → theme tokens → data → plot → style → save; no
195-
functions or classes'
186+
comment: 'Flat script: imports → theme tokens → data → plot → save'
196187
- id: CQ-02
197188
name: Reproducibility
198189
score: 2
199190
max: 2
200191
passed: true
201-
comment: np.random.seed(42) set
192+
comment: np.random.seed(42)
202193
- id: CQ-03
203194
name: Clean Imports
204195
score: 2
205196
max: 2
206197
passed: true
207-
comment: Only os, matplotlib.pyplot, numpy — all used
198+
comment: os, matplotlib as mpl, matplotlib.pyplot as plt, numpy as np — all
199+
used
208200
- id: CQ-04
209201
name: Code Elegance
210202
score: 2
211203
max: 2
212204
passed: true
213-
comment: Clean Pythonic code; no over-engineering; no fake UI elements
205+
comment: Clean, Pythonic, appropriate complexity
214206
- id: CQ-05
215207
name: Output & API
216208
score: 1
217209
max: 1
218210
passed: true
219-
comment: Saves as plot-{THEME}.png with dpi=300, bbox_inches=tight, facecolor=PAGE_BG;
220-
uses Axes methods
211+
comment: f'plot-{THEME}.png' correct; no deprecated functions
221212
library_mastery:
222-
score: 6
213+
score: 7
223214
max: 10
224215
items:
225216
- id: LM-01
226217
name: Idiomatic Usage
227218
score: 4
228219
max: 5
229220
passed: true
230-
comment: ax.scatter not plt.scatter; proper spines API; tick_params; set_axisbelow
231-
correct and idiomatic
221+
comment: Axes-method API, mpl.rcParams.update(), set_axisbelow(), ax.margins()
222+
well above generic usage
232223
- id: LM-02
233224
name: Distinctive Features
234-
score: 2
225+
score: 3
235226
max: 5
236-
passed: false
237-
comment: set_axisbelow and edgecolors are matplotlib-specific but basic; no
238-
use of rcParams, PathCollection, or advanced matplotlib capabilities
227+
passed: true
228+
comment: mpl.rcParams.update() for typography, edgecolors=PAGE_BG for theme-adaptive
229+
edges, set_axisbelow(), tick_params(length=0) — multiple matplotlib-specific
230+
techniques
239231
verdict: REJECTED
240232
impl_tags:
241233
dependencies: []
@@ -247,4 +239,3 @@ impl_tags:
247239
styling:
248240
- alpha-blending
249241
- edge-highlighting
250-
- grid-styling

0 commit comments

Comments
 (0)