Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plots/streamgraph-basic/implementations/python/plotnine.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" pyplots.ai
""" anyplot.ai
streamgraph-basic: Basic Stream Graph
Library: plotnine 0.15.1 | Python 3.13.11
Quality: 98/100 | Created: 2025-12-14
Library: plotnine 0.15.3 | Python 3.13.13
Quality: 84/100 | Created: 2026-05-06
"""

import numpy as np
Expand Down
252 changes: 234 additions & 18 deletions plots/streamgraph-basic/metadata/python/plotnine.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,242 @@
library: plotnine
language: python
specification_id: streamgraph-basic
created: 2025-12-14 19:44:18+00:00
updated: 2025-12-14 19:44:18+00:00
generated_by: claude-opus-4-5-20251101
workflow_run: 20213171391
updated: '2026-05-06T21:56:57Z'
generated_by: claude-sonnet
workflow_run: 25356129081
issue: 856
python_version: 3.13.11
library_version: 0.15.1
preview_url: https://storage.googleapis.com/anyplot-images/plots/streamgraph-basic/plotnine/plot.png
preview_html: null
quality_score: 98
python_version: 3.13.13
library_version: 0.15.3
preview_url_light: https://storage.googleapis.com/anyplot-images/plots/streamgraph-basic/python/plotnine/plot-light.png
preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/streamgraph-basic/python/plotnine/plot-dark.png
preview_html_light: null
preview_html_dark: null
quality_score: 84
review:
strengths:
- 'Perfect visual quality: all text explicitly sized, no overlap, correct Okabe-Ito
palette, proper theme-adaptive chrome in both renders'
- Correct streamgraph with centered baseline using numpy matrix operations and geom_ribbon
- Realistic neutral music streaming dataset with plausible values
- Clean reproducible code with pd.Categorical for stacking order control
weaknesses:
- No spline/basis interpolation for smooth flowing curves as spec requires; linear
interpolation gives adequate but not canonical streamgraph curves
- 'Design excellence thin: no explicit spine removal, no visual hierarchy or storytelling,
no focal point or emphasis'
- Legend box uses default styling without elevation treatment matching style guide
image_description: |-
Light render (plot-light.png):
Background: Warm off-white (~#FAF8F1) — correct light theme surface, not pure white
Chrome: Title "streamgraph-basic · plotnine · anyplot.ai" in dark text, clearly readable. Axis labels "Month" and "Streaming Hours" visible. Tick labels "Jan '23", "Jul '23", "Jan '24", "Jul '24" and Y-axis numerics (-400 to 400) all clearly readable in dark tones against the warm background. Legend on right side with dark text on light background.
Data: Five genre bands — Pop (teal #009E73, Okabe-Ito position 1), Rock (orange-red #D55E00), Hip-Hop (blue #0072B2), Electronic (pink #CC79A7), Jazz (gold #E69F00). Colors match Okabe-Ito canonical order. Alpha ~0.85 gives slight transparency. Centered baseline symmetric around Y=0.
Legibility verdict: PASS — all text readable, no light-on-light failures

Dark render (plot-dark.png):
Background: Warm near-black (~#1A1A17) — correct dark theme surface, not pure black
Chrome: Title, axis labels, and tick labels rendered in light/near-white text, clearly readable against the dark background. Legend text in light tones, readable. No dark-on-dark failures detected — no near-black text on near-black background anywhere.
Data: Colors identical to light render — Pop still teal #009E73, Rock orange-red, Hip-Hop blue, Electronic pink, Jazz gold. Data colors correctly theme-independent.
Legibility verdict: PASS — all text readable against dark background, no dark-on-dark failures
criteria_checklist:
visual_quality:
score: 30
max: 30
items:
- id: VQ-01
name: Text Legibility
score: 8
max: 8
passed: true
comment: All font sizes explicitly set (title 24pt, axis 20pt, ticks 16pt,
legend 16pt); readable in both themes
- id: VQ-02
name: No Overlap
score: 6
max: 6
passed: true
comment: No overlapping text; four x-axis tick labels well-spaced
- id: VQ-03
name: Element Visibility
score: 6
max: 6
passed: true
comment: Stream bands clearly visible, well-adapted to canvas density
- id: VQ-04
name: Color Accessibility
score: 2
max: 2
passed: true
comment: Okabe-Ito palette is CVD-safe; five distinct colors with good luminance
contrast
- id: VQ-05
name: Layout & Canvas
score: 4
max: 4
passed: true
comment: Plot fills canvas well; legend positioned to the right without isolation
- id: VQ-06
name: Axis Labels & Title
score: 2
max: 2
passed: true
comment: Month and Streaming Hours are descriptive labels
- id: VQ-07
name: Palette Compliance
score: 2
max: 2
passed: true
comment: Okabe-Ito order confirmed (Pop=#009E73 first); light bg warm off-white;
dark bg warm near-black; chrome adapts correctly
design_excellence:
score: 9
max: 20
items:
- id: DE-01
name: Aesthetic Sophistication
score: 4
max: 8
passed: false
comment: Professional and clean but remains a well-configured library default;
no intentional typographic hierarchy or bespoke design touches
- id: DE-02
name: Visual Refinement
score: 3
max: 6
passed: false
comment: theme_minimal provides clean defaults but no explicit spine removal,
default legend box styling, no elevation treatment
- id: DE-03
name: Data Storytelling
score: 2
max: 6
passed: false
comment: Chart accurately represents trends but no visual emphasis; no genre
highlighted; viewer must discover insights independently
spec_compliance:
score: 14
max: 15
items:
- id: SC-01
name: Plot Type
score: 5
max: 5
passed: true
comment: Correct streamgraph with centered baseline using geom_ribbon with
pre-computed ymin/ymax positions
- id: SC-02
name: Required Features
score: 3
max: 4
passed: false
comment: Centered baseline, legend, distinct colors present; but spec requires
spline/basis smooth interpolation — implementation uses linear interpolation
between monthly points
- id: SC-03
name: Data Mapping
score: 3
max: 3
passed: true
comment: Time on X, streaming hours on Y, genres stacked; full data range
shown
- id: SC-04
name: Title & Legend
score: 3
max: 3
passed: true
comment: Title correctly formatted as streamgraph-basic · plotnine · anyplot.ai;
legend labels match genre names
data_quality:
score: 14
max: 15
items:
- id: DQ-01
name: Feature Coverage
score: 5
max: 6
passed: true
comment: Multiple categories with varying magnitudes and sinusoidal trends;
could show more divergent trend shapes
- id: DQ-02
name: Realistic Context
score: 5
max: 5
passed: true
comment: Monthly streaming hours by music genre over two years is realistic,
neutral, comprehensible
- id: DQ-03
name: Appropriate Scale
score: 4
max: 4
passed: true
comment: Per-genre values 20-250 hours/month with plausible variation; factually
reasonable for a streaming platform
code_quality:
score: 10
max: 10
items:
- id: CQ-01
name: KISS Structure
score: 3
max: 3
passed: true
comment: 'Clean linear flow: imports -> data -> computation -> plot -> save;
no functions or classes'
- id: CQ-02
name: Reproducibility
score: 2
max: 2
passed: true
comment: np.random.seed(42) ensures deterministic output
- id: CQ-03
name: Clean Imports
score: 2
max: 2
passed: true
comment: All imported symbols are used
- id: CQ-04
name: Code Elegance
score: 2
max: 2
passed: true
comment: Matrix operations for centered baseline are appropriately complex
and clearly structured
- id: CQ-05
name: Output & API
score: 1
max: 1
passed: true
comment: Both plot-light.png and plot-dark.png produced correctly with ANYPLOT_THEME
handling
library_mastery:
score: 7
max: 10
items:
- id: LM-01
name: Idiomatic Usage
score: 4
max: 5
passed: true
comment: Idiomatic ggplot grammar with geom_ribbon, aes(ymin/ymax), scale_fill_manual,
scale_x_continuous with custom breaks, theme overrides
- id: LM-02
name: Distinctive Features
score: 3
max: 5
passed: true
comment: Pre-computed centered baseline mapped through aes(ymin/ymax) is characteristic
plotnine/ggplot2 pattern; pd.Categorical with ordered levels for stacking
control is plotnine-specific
verdict: APPROVED
impl_tags:
dependencies: []
techniques: []
techniques:
- manual-ticks
patterns:
- data-generation
- matrix-construction
dataprep: []
- data-generation
- matrix-construction
- iteration-over-groups
dataprep:
- cumulative-sum
styling:
- alpha-blending
review:
strengths: []
weaknesses: []
improvements: []
verdict: APPROVED
- alpha-blending
Loading