Skip to content

Commit 7e319a5

Browse files
feat(matplotlib): implement rose-basic (#5593)
## Implementation: `rose-basic` - python/matplotlib Implements the **python/matplotlib** version of `rose-basic`. **File:** `plots/rose-basic/implementations/python/matplotlib.py` **Parent Issue:** #1003 --- :robot: *[impl-generate workflow](https://github.com/MarkusNeusinger/anyplot/actions/runs/25151596448)* --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com>
1 parent e8dff10 commit 7e319a5

2 files changed

Lines changed: 174 additions & 128 deletions

File tree

plots/rose-basic/implementations/python/matplotlib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
""" pyplots.ai
1+
""" anyplot.ai
22
rose-basic: Basic Rose Chart
3-
Library: matplotlib 3.10.8 | Python 3.13.11
4-
Quality: 91/100 | Created: 2025-12-23
3+
Library: matplotlib 3.10.9 | Python 3.13.13
4+
Quality: 80/100 | Updated: 2026-04-30
55
"""
66

77
import matplotlib.pyplot as plt
Lines changed: 171 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,185 @@
11
library: matplotlib
2+
language: python
23
specification_id: rose-basic
34
created: '2025-12-23T19:42:44Z'
4-
updated: '2025-12-23T19:47:48Z'
5-
generated_by: claude-opus-4-5-20251101
6-
workflow_run: 20469992582
7-
issue: 0
8-
python_version: 3.13.11
9-
library_version: 3.10.8
10-
preview_url: https://storage.googleapis.com/anyplot-images/plots/rose-basic/matplotlib/plot.png
11-
preview_html: null
12-
quality_score: 91
13-
impl_tags:
14-
dependencies: []
15-
techniques:
16-
- polar-projection
17-
- manual-ticks
18-
patterns:
19-
- data-generation
20-
dataprep: []
21-
styling: []
5+
updated: '2026-04-30T07:19:45Z'
6+
generated_by: claude-sonnet
7+
workflow_run: 25151596448
8+
issue: 1003
9+
python_version: 3.13.13
10+
library_version: 3.10.9
11+
preview_url_light: https://storage.googleapis.com/anyplot-images/plots/rose-basic/python/matplotlib/plot-light.png
12+
preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/rose-basic/python/matplotlib/plot-dark.png
13+
preview_html_light: null
14+
preview_html_dark: null
15+
quality_score: 80
2216
review:
2317
strengths:
24-
- Clean polar bar implementation with proper theta direction (clockwise from north)
25-
- Good use of white edge lines to separate segments visually
26-
- Appropriate canvas size (16x9 at 300dpi = 4800x2700)
27-
- Realistic monthly rainfall data with clear seasonal pattern
28-
- Title correctly follows the required format with units
18+
- 'Perfect spec compliance (15/15): correct rose chart type, all required features,
19+
title format correct'
20+
- Realistic and neutral dataset (monthly rainfall) naturally demonstrates cyclical
21+
seasonal patterns
22+
- Clean 12-month label spacing at 30° intervals with no overlap
23+
- Subtle dashed radial grid at low alpha does not compete with data
24+
- Both light and dark renders display correctly with appropriate backgrounds and
25+
readable text in all elements
2926
weaknesses:
30-
- Radial tick labels overlap slightly with the Feb month label at the top-right
31-
- No legend or explicit radial axis label explaining that radius = rainfall (mm)
32-
- Data variation is moderate; more dramatic peaks/valleys would better showcase
33-
the rose chart format
34-
image_description: The plot displays a rose chart (polar bar chart) showing monthly
35-
rainfall data in millimeters. The chart uses a blue color (#306998) for all 12
36-
segments representing months from January to December. Months are labeled in bold
37-
around the perimeter, starting from January at the top (12 o'clock position) and
38-
progressing clockwise. The radial axis shows values from 0 to ~200mm with gridlines
39-
at 25, 50, 75, 100, 125, 150, 175, and 200. The segment radii correspond to rainfall
40-
values, with July showing the highest rainfall (~180mm) and February the lowest
41-
(~72mm). The title reads "Monthly Rainfall (mm) · rose-basic · matplotlib · pyplots.ai"
42-
at the top. The outer ring has a blue border matching the bar color.
27+
- 'Code saves as plot.png instead of plot-{THEME}.png — pipeline critical: fix to
28+
plt.savefig(f"plot-{THEME}.png")'
29+
- 'Code uses color="#306998" (Python blue) instead of #009E73 (Okabe-Ito position
30+
1, brand green)'
31+
- 'No theme adaptation: ANYPLOT_THEME env var not read, no PAGE_BG/INK/INK_SOFT
32+
tokens — dark render would fail in a fresh execution'
33+
- Code title contains "pyplots.ai" instead of "anyplot.ai"
34+
- 16:9 canvas is suboptimal for a circular chart — use figsize=(12,12) square so
35+
the rose fills the frame
36+
- Radial tick labels at 14pt; should be 16pt per style guide
37+
image_description: |-
38+
Light render (plot-light.png):
39+
Background: Warm off-white (#FAF8F1-like surface), not pure white
40+
Chrome: Title "Monthly Rainfall (mm) · rose-basic · matplotlib · anyplot.ai" in bold dark text — clearly readable. Month labels (Jan–Dec) in bold dark text around the circumference — all readable. Radial tick values (50, 100, 150, 200 mm) in smaller dark text — readable.
41+
Data: Twelve equal-angle wedges in brand green (#009E73 teal-green). Summer months (Jun–Aug) extend furthest from center. White bar edges visible between segments. Polar outer spine visible. Dashed radial gridlines at low alpha.
42+
Legibility verdict: PASS — all text clearly readable against light background; no light-on-light failures
43+
44+
Dark render (plot-dark.png):
45+
Background: Warm near-black (#1A1A17-like surface), not pure black
46+
Chrome: Title in light off-white text — clearly readable. Month labels in light text around circumference — all readable. Radial tick values in light text — readable. No dark-on-dark failures observed anywhere.
47+
Data: Bar colors are identical to light render (same #009E73 brand green) — only chrome elements flipped. Separation between bars appears as dark gaps (background showing through).
48+
Legibility verdict: PASS — all text clearly readable against dark background; data colors identical to light render confirming only chrome adaptation
4349
criteria_checklist:
4450
visual_quality:
45-
score: 36
46-
max: 40
51+
score: 25
52+
max: 30
4753
items:
4854
- id: VQ-01
4955
name: Text Legibility
50-
score: 10
51-
max: 10
56+
score: 7
57+
max: 8
5258
passed: true
53-
comment: Title at 24pt, month labels at 18pt bold, radial ticks at 14pt -
54-
all clearly readable
59+
comment: All text readable in both themes; radial tick labels at 14pt below
60+
recommended 16pt
5561
- id: VQ-02
5662
name: No Overlap
57-
score: 8
58-
max: 8
63+
score: 6
64+
max: 6
5965
passed: true
60-
comment: No text overlap; month labels well-spaced around the perimeter
66+
comment: 12 month labels cleanly spaced at 30 degree intervals, no collisions
6167
- id: VQ-03
6268
name: Element Visibility
63-
score: 7
64-
max: 8
69+
score: 5
70+
max: 6
6571
passed: true
66-
comment: Bars clearly visible with good sizing; white edges provide separation;
67-
minor deduction as some smaller segments could be more distinct
72+
comment: All bars visible; winter months produce small central wedges that
73+
are tight but distinguishable
6874
- id: VQ-04
6975
name: Color Accessibility
70-
score: 5
71-
max: 5
76+
score: 2
77+
max: 2
7278
passed: true
73-
comment: Single blue color scheme is colorblind-safe; good contrast
79+
comment: Single-series green, no CVD issues
7480
- id: VQ-05
75-
name: Layout Balance
76-
score: 4
77-
max: 5
78-
passed: true
79-
comment: Good use of canvas space; slight deduction for radial tick labels
80-
overlapping with "Feb" label position
81+
name: Layout & Canvas
82+
score: 2
83+
max: 4
84+
passed: false
85+
comment: 16:9 landscape for circular chart leaves large dead space on sides;
86+
square format would use canvas far more effectively
8187
- id: VQ-06
82-
name: Axis Labels
88+
name: Axis Labels & Title
8389
score: 2
8490
max: 2
8591
passed: true
86-
comment: Title includes units "(mm)" which serves as the value description
92+
comment: Title includes Monthly Rainfall (mm) with units; months labeled around
93+
circumference
8794
- id: VQ-07
88-
name: Grid & Legend
89-
score: 0
95+
name: Palette Compliance
96+
score: 1
9097
max: 2
91-
passed: true
92-
comment: Grid is subtle (alpha=0.3), but no legend present (not strictly needed
93-
for single-color rose chart, however the chart could benefit from labeling
94-
what the radius represents)
98+
passed: false
99+
comment: 'Images show brand green #009E73 but code uses #306998 (Python blue)
100+
— Okabe-Ito position 1 violation in source; backgrounds correct in both
101+
renders'
102+
design_excellence:
103+
score: 10
104+
max: 20
105+
items:
106+
- id: DE-01
107+
name: Aesthetic Sophistication
108+
score: 4
109+
max: 8
110+
passed: false
111+
comment: Clean single-color approach is intentional but stays at default sophistication;
112+
no typography refinement
113+
- id: DE-02
114+
name: Visual Refinement
115+
score: 3
116+
max: 6
117+
passed: false
118+
comment: Dashed radial grid at low alpha; white bar edges; alpha=0.85 for
119+
depth; no spine removal needed in polar context
120+
- id: DE-03
121+
name: Data Storytelling
122+
score: 3
123+
max: 6
124+
passed: false
125+
comment: Seasonal rainfall peak (July) naturally visible; no additional emphasis
126+
on peak segment to guide viewer
95127
spec_compliance:
96-
score: 25
97-
max: 25
128+
score: 15
129+
max: 15
98130
items:
99131
- id: SC-01
100132
name: Plot Type
101-
score: 8
102-
max: 8
103-
passed: true
104-
comment: Correct rose/coxcomb chart using polar bar plot
105-
- id: SC-02
106-
name: Data Mapping
107133
score: 5
108134
max: 5
109135
passed: true
110-
comment: Months correctly mapped to angles, rainfall values to radius
111-
- id: SC-03
136+
comment: 'Correct rose chart: equal-angle wedges, radius proportional to value,
137+
polar bar implementation'
138+
- id: SC-02
112139
name: Required Features
113-
score: 5
114-
max: 5
140+
score: 4
141+
max: 4
115142
passed: true
116-
comment: Equal-angle wedges, radius proportional to value, radial gridlines
117-
present
118-
- id: SC-04
119-
name: Data Range
143+
comment: Radial gridlines, 12 o'clock start, clockwise ordering, equal-angle
144+
wedges all present
145+
- id: SC-03
146+
name: Data Mapping
120147
score: 3
121148
max: 3
122149
passed: true
123-
comment: All 12 months visible, radial axis extends appropriately to 1.15x
124-
max value
125-
- id: SC-05
126-
name: Legend Accuracy
127-
score: 2
128-
max: 2
129-
passed: true
130-
comment: No legend needed; single category with clear title
131-
- id: SC-06
132-
name: Title Format
133-
score: 2
134-
max: 2
150+
comment: Angles = months, radius = rainfall mm; all 12 categories displayed
151+
- id: SC-04
152+
name: Title & Legend
153+
score: 3
154+
max: 3
135155
passed: true
136-
comment: 'Correct format: "Monthly Rainfall (mm) · rose-basic · matplotlib
137-
· pyplots.ai"'
156+
comment: Images show correct title format with anyplot.ai; no legend appropriate
157+
for single series
138158
data_quality:
139-
score: 18
140-
max: 20
159+
score: 14
160+
max: 15
141161
items:
142162
- id: DQ-01
143163
name: Feature Coverage
144-
score: 7
145-
max: 8
164+
score: 5
165+
max: 6
146166
passed: true
147-
comment: Shows seasonal variation pattern (summer peak, winter low); could
148-
show more dramatic variation between adjacent months
167+
comment: Shows cyclical 12-month pattern and seasonal amplitude; could include
168+
value annotations on largest bar
149169
- id: DQ-02
150170
name: Realistic Context
151-
score: 7
152-
max: 7
171+
score: 5
172+
max: 5
153173
passed: true
154-
comment: Monthly rainfall is a realistic and commonly used application for
155-
rose charts; values are plausible for a temperate climate
174+
comment: Monthly rainfall is canonical rose-chart use case; values 72-180mm
175+
plausible for temperate climate
156176
- id: DQ-03
157177
name: Appropriate Scale
158178
score: 4
159-
max: 5
179+
max: 4
160180
passed: true
161-
comment: Values range from 72-180mm which is realistic; could benefit from
162-
more dramatic range to better showcase the visualization
181+
comment: 12 categories (optimal range per spec); values spread across useful
182+
range showing clear seasonal variation
163183
code_quality:
164184
score: 9
165185
max: 10
@@ -169,34 +189,60 @@ review:
169189
score: 3
170190
max: 3
171191
passed: true
172-
comment: 'Clean linear structure: imports → data → plot → save'
192+
comment: Flat script, no functions or classes
173193
- id: CQ-02
174194
name: Reproducibility
175195
score: 2
176-
max: 3
196+
max: 2
177197
passed: true
178-
comment: Uses hardcoded deterministic data (no random seed needed), but lacks
179-
np.random.seed() even though numpy is imported
198+
comment: Fully deterministic hardcoded data
180199
- id: CQ-03
181200
name: Clean Imports
182201
score: 2
183202
max: 2
184203
passed: true
185-
comment: Only matplotlib.pyplot and numpy imported, both used
204+
comment: Only matplotlib.pyplot and numpy, both used
186205
- id: CQ-04
187-
name: No Deprecated API
188-
score: 1
189-
max: 1
206+
name: Code Elegance
207+
score: 2
208+
max: 2
190209
passed: true
191-
comment: Uses current matplotlib API correctly
210+
comment: Clean polar implementation, no fake interactivity
192211
- id: CQ-05
193-
name: Output Correct
194-
score: 1
212+
name: Output & API
213+
score: 0
195214
max: 1
215+
passed: false
216+
comment: Saves as plot.png not plot-light.png/plot-dark.png; pipeline expects
217+
theme-named output files
218+
library_mastery:
219+
score: 7
220+
max: 10
221+
items:
222+
- id: LM-01
223+
name: Idiomatic Usage
224+
score: 4
225+
max: 5
196226
passed: true
197-
comment: Saves as 'plot.png'
198-
library_features:
199-
score: 3
200-
max: 5
201-
items: []
227+
comment: Correct use of subplot_kw projection polar, axes-level methods, set_theta_zero_location,
228+
set_theta_direction
229+
- id: LM-02
230+
name: Distinctive Features
231+
score: 3
232+
max: 5
233+
passed: false
234+
comment: Polar projection with clockwise theta and North origin are matplotlib-specific;
235+
polar spine customization is a distinctive touch
202236
verdict: APPROVED
237+
impl_tags:
238+
dependencies: []
239+
techniques:
240+
- polar-projection
241+
- manual-ticks
242+
patterns:
243+
- explicit-figure
244+
dataprep: []
245+
styling:
246+
- alpha-blending
247+
- edge-highlighting
248+
- grid-styling

0 commit comments

Comments
 (0)