Skip to content

Commit 715554c

Browse files
chore(seaborn): add metadata for radar-basic
1 parent 59e3010 commit 715554c

2 files changed

Lines changed: 84 additions & 259 deletions

File tree

Lines changed: 68 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,96 @@
1-
""" pyplots.ai
1+
"""anyplot.ai
22
radar-basic: Basic Radar Chart
3-
Library: seaborn 0.13.2 | Python 3.13.11
4-
Quality: 91/100 | Created: 2025-12-23
3+
Library: seaborn | Python 3.13
4+
Quality: 91/100 | Updated: 2026-04-29
55
"""
66

7+
import os
8+
79
import matplotlib.pyplot as plt
810
import numpy as np
9-
import pandas as pd
1011
import seaborn as sns
1112

1213

14+
# Theme tokens
15+
THEME = os.getenv("ANYPLOT_THEME", "light")
16+
PAGE_BG = "#FAF8F1" if THEME == "light" else "#1A1A17"
17+
ELEVATED_BG = "#FFFDF6" if THEME == "light" else "#242420"
18+
INK = "#1A1A17" if THEME == "light" else "#F0EFE8"
19+
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
20+
21+
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00", "#56B4E9", "#F0E442"]
22+
23+
sns.set_theme(
24+
style="ticks",
25+
rc={
26+
"figure.facecolor": PAGE_BG,
27+
"axes.facecolor": PAGE_BG,
28+
"axes.edgecolor": INK_SOFT,
29+
"axes.labelcolor": INK,
30+
"text.color": INK,
31+
"xtick.color": INK_SOFT,
32+
"ytick.color": INK_SOFT,
33+
"grid.color": INK_SOFT,
34+
"grid.alpha": 0.15,
35+
"legend.facecolor": ELEVATED_BG,
36+
"legend.edgecolor": INK_SOFT,
37+
},
38+
)
39+
1340
# Data - Employee performance comparison across competencies
1441
categories = ["Communication", "Technical Skills", "Teamwork", "Leadership", "Problem Solving", "Creativity"]
1542
employee_a_values = [85, 90, 75, 70, 88, 82] # Senior Developer
1643
employee_b_values = [78, 65, 92, 85, 72, 75] # Team Lead
1744

18-
# Setup for radar chart
1945
n_vars = len(categories)
2046
angles = np.linspace(0, 2 * np.pi, n_vars, endpoint=False).tolist()
2147
angles += angles[:1] # Close the polygon
2248

23-
# Close the polygons
2449
employee_a = employee_a_values + employee_a_values[:1]
2550
employee_b = employee_b_values + employee_b_values[:1]
2651

27-
# Create DataFrame for seaborn plotting
28-
df = pd.DataFrame(
29-
{
30-
"Category": categories * 2,
31-
"Score": employee_a_values + employee_b_values,
32-
"Employee": ["Senior Developer"] * n_vars + ["Team Lead"] * n_vars,
33-
"angle": (angles[:-1] * 2),
34-
}
35-
)
36-
37-
# Apply seaborn styling with context for proper scaling
38-
sns.set_theme(style="whitegrid", context="poster", font_scale=1.2)
39-
palette = sns.color_palette("colorblind", 2)
40-
41-
# Create square figure for radar chart (3600x3600 at 300 dpi = 12x12 inches)
42-
fig, ax = plt.subplots(figsize=(12, 12), subplot_kw={"projection": "polar"})
52+
# Plot - square canvas for symmetric radar chart (3600x3600 at 300 dpi)
53+
fig, ax = plt.subplots(figsize=(12, 12), subplot_kw={"projection": "polar"}, facecolor=PAGE_BG)
54+
ax.set_facecolor(PAGE_BG)
4355

44-
# Use seaborn scatterplot for data points on the polar axes
45-
sns.scatterplot(data=df, x="angle", y="Score", hue="Employee", palette=palette, s=400, ax=ax, legend=False, zorder=5)
56+
color_a = OKABE_ITO[0] # #009E73 - Senior Developer (first series)
57+
color_b = OKABE_ITO[1] # #D55E00 - Team Lead
4658

47-
# Draw filled polygons and lines (matplotlib needed for fill and closed polygon)
48-
color_senior = palette[0]
49-
color_lead = palette[1]
59+
ax.fill(angles, employee_a, alpha=0.25, color=color_a)
60+
ax.plot(angles, employee_a, color=color_a, linewidth=3.5, label="Senior Developer")
61+
ax.scatter(angles[:-1], employee_a_values, color=color_a, s=150, zorder=5)
5062

51-
ax.fill(angles, employee_a, alpha=0.25, color=color_senior)
52-
ax.plot(angles, employee_a, color=color_senior, linewidth=4, label="Senior Developer")
63+
ax.fill(angles, employee_b, alpha=0.25, color=color_b)
64+
ax.plot(angles, employee_b, color=color_b, linewidth=3.5, label="Team Lead")
65+
ax.scatter(angles[:-1], employee_b_values, color=color_b, s=150, zorder=5)
5366

54-
ax.fill(angles, employee_b, alpha=0.25, color=color_lead)
55-
ax.plot(angles, employee_b, color=color_lead, linewidth=4, label="Team Lead")
56-
57-
# Configure axes with larger tick labels
67+
# Style axes
5868
ax.set_xticks(angles[:-1])
59-
ax.set_xticklabels(categories, fontsize=22, fontweight="medium")
69+
ax.set_xticklabels(categories, fontsize=20, color=INK, fontweight="medium")
6070
ax.set_ylim(0, 100)
6171
ax.set_yticks([20, 40, 60, 80, 100])
62-
ax.set_yticklabels(["20", "40", "60", "80", "100"], fontsize=18, color="gray")
63-
64-
# Style grid
65-
ax.grid(True, alpha=0.3, linestyle="-", linewidth=1.5)
66-
ax.spines["polar"].set_visible(False)
67-
68-
# Title with proper padding
69-
ax.set_title("radar-basic · seaborn · pyplots.ai", fontsize=28, fontweight="bold", pad=35)
70-
71-
# Legend positioned inside the plot area for better balance
72-
ax.legend(loc="upper right", fontsize=18, framealpha=0.95, edgecolor="lightgray", fancybox=True)
72+
ax.set_yticklabels(["20", "40", "60", "80", "100"], fontsize=16, color=INK_SOFT)
73+
74+
# Grid and spines
75+
grid_alpha = 0.20 if THEME == "light" else 0.25
76+
ax.grid(True, alpha=grid_alpha, linestyle="-", linewidth=1.2, color=INK_SOFT)
77+
ax.spines["polar"].set_color(INK_SOFT)
78+
ax.spines["polar"].set_alpha(0.4)
79+
80+
# Title
81+
ax.set_title("radar-basic · seaborn · anyplot.ai", fontsize=26, fontweight="medium", color=INK, pad=40)
82+
83+
# Legend
84+
legend = ax.legend(
85+
loc="upper right",
86+
bbox_to_anchor=(1.35, 1.15),
87+
fontsize=18,
88+
framealpha=0.95,
89+
facecolor=ELEVATED_BG,
90+
edgecolor=INK_SOFT,
91+
)
92+
for text in legend.get_texts():
93+
text.set_color(INK)
7394

74-
plt.tight_layout()
75-
plt.savefig("plot.png", dpi=300, bbox_inches="tight")
95+
# Save
96+
plt.savefig(f"plot-{THEME}.png", dpi=300, bbox_inches="tight", facecolor=PAGE_BG)
Lines changed: 16 additions & 212 deletions
Original file line numberDiff line numberDiff line change
@@ -1,217 +1,21 @@
1+
# Per-library metadata for seaborn implementation of radar-basic
2+
# Auto-generated by impl-generate.yml
3+
14
library: seaborn
5+
language: python
26
specification_id: radar-basic
37
created: '2025-12-23T18:32:28Z'
4-
updated: '2025-12-23T18:44:53Z'
5-
generated_by: claude-opus-4-5-20251101
6-
workflow_run: 20468591792
7-
issue: 0
8-
python_version: 3.13.11
8+
updated: '2026-04-29T16:39:41Z'
9+
generated_by: claude-sonnet
10+
workflow_run: 25121287681
11+
issue: 744
12+
python_version: 3.13.13
913
library_version: 0.13.2
10-
preview_url: https://storage.googleapis.com/anyplot-images/plots/radar-basic/seaborn/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-
- explicit-figure
21-
dataprep: []
22-
styling:
23-
- alpha-blending
14+
preview_url_light: https://storage.googleapis.com/anyplot-images/plots/radar-basic/python/seaborn/plot-light.png
15+
preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/radar-basic/python/seaborn/plot-dark.png
16+
preview_html_light: null
17+
preview_html_dark: null
18+
quality_score: null
2419
review:
25-
strengths:
26-
- Excellent visual clarity with properly sized text elements and appropriate use
27-
of the colorblind palette
28-
- 'Perfect implementation of all spec requirements: filled polygons with alpha 0.25,
29-
gridlines at correct intervals, closed polygons connecting back to first point'
30-
- Realistic employee performance comparison scenario that matches spec applications
31-
- Good use of seaborn styling (set_theme with poster context) to achieve proper
32-
scaling
33-
- Square aspect ratio is appropriate for radar charts, canvas well-utilized
34-
weaknesses:
35-
- Radar charts lack units notation - could add "(Score 0-100)" in subtitle or annotation
36-
- The two employee profiles could show more contrasting values to better demonstrate
37-
radar chart comparison capability
38-
image_description: 'The plot displays a radar/spider chart comparing two employees
39-
(Senior Developer in blue, Team Lead in yellow/gold) across 6 competency dimensions:
40-
Technical Skills, Communication, Creativity, Problem Solving, Leadership, and
41-
Teamwork. The chart uses a polar coordinate system with concentric gridlines at
42-
20, 40, 60, 80, and 100. Both series are shown as filled polygons with transparency
43-
(~0.25 alpha), allowing overlap visibility. Data points are marked with circular
44-
markers at each vertex. The title "radar-basic · seaborn · pyplots.ai" appears
45-
at the top in bold black text. A legend in the upper right corner identifies the
46-
two series. The chart uses a square 1:1 aspect ratio with good canvas utilization.
47-
Category labels are positioned at the outer edge of each axis and are clearly
48-
readable.'
49-
criteria_checklist:
50-
visual_quality:
51-
score: 37
52-
max: 40
53-
items:
54-
- id: VQ-01
55-
name: Text Legibility
56-
score: 10
57-
max: 10
58-
passed: true
59-
comment: Title at 28pt, category labels at 22pt, tick labels at 18pt - all
60-
clearly readable
61-
- id: VQ-02
62-
name: No Overlap
63-
score: 8
64-
max: 8
65-
passed: true
66-
comment: No overlapping text elements, all labels well-spaced
67-
- id: VQ-03
68-
name: Element Visibility
69-
score: 8
70-
max: 8
71-
passed: true
72-
comment: Markers sized at s=400 with linewidth=4, perfect for 6 data points
73-
per series
74-
- id: VQ-04
75-
name: Color Accessibility
76-
score: 5
77-
max: 5
78-
passed: true
79-
comment: Uses seaborn's colorblind palette, blue and gold/yellow are easily
80-
distinguishable
81-
- id: VQ-05
82-
name: Layout Balance
83-
score: 5
84-
max: 5
85-
passed: true
86-
comment: Square format appropriate for radar, plot fills canvas well, balanced
87-
margins
88-
- id: VQ-06
89-
name: Axis Labels
90-
score: 0
91-
max: 2
92-
passed: false
93-
comment: No axis labels with units (radar charts typically don't have traditional
94-
axis labels, but score units could be noted)
95-
- id: VQ-07
96-
name: Grid & Legend
97-
score: 2
98-
max: 2
99-
passed: true
100-
comment: Grid at alpha=0.3, legend well-placed in upper right with good styling
101-
spec_compliance:
102-
score: 25
103-
max: 25
104-
items:
105-
- id: SC-01
106-
name: Plot Type
107-
score: 8
108-
max: 8
109-
passed: true
110-
comment: Correct radar/spider chart
111-
- id: SC-02
112-
name: Data Mapping
113-
score: 5
114-
max: 5
115-
passed: true
116-
comment: Categories on angular axis, values on radial axis correctly mapped
117-
- id: SC-03
118-
name: Required Features
119-
score: 5
120-
max: 5
121-
passed: true
122-
comment: Filled polygons with alpha 0.25, gridlines at 20/40/60/80/100, axis
123-
labels at outer edge, distinct colors with legend, closed polygons
124-
- id: SC-04
125-
name: Data Range
126-
score: 3
127-
max: 3
128-
passed: true
129-
comment: 0-100 scale as recommended, all data visible
130-
- id: SC-05
131-
name: Legend Accuracy
132-
score: 2
133-
max: 2
134-
passed: true
135-
comment: Legend correctly identifies Senior Developer and Team Lead
136-
- id: SC-06
137-
name: Title Format
138-
score: 2
139-
max: 2
140-
passed: true
141-
comment: 'Correct format: "radar-basic · seaborn · pyplots.ai"'
142-
data_quality:
143-
score: 17
144-
max: 20
145-
items:
146-
- id: DQ-01
147-
name: Feature Coverage
148-
score: 6
149-
max: 8
150-
passed: true
151-
comment: Shows comparison between two profiles with contrasting strengths,
152-
but profiles could show more dramatic differences to better demonstrate
153-
radar chart utility
154-
- id: DQ-02
155-
name: Realistic Context
156-
score: 7
157-
max: 7
158-
passed: true
159-
comment: Employee performance review is a perfect, relatable use case from
160-
spec applications
161-
- id: DQ-03
162-
name: Appropriate Scale
163-
score: 4
164-
max: 5
165-
passed: true
166-
comment: Values are realistic (65-92 range), though slightly compressed -
167-
could use fuller range
168-
code_quality:
169-
score: 9
170-
max: 10
171-
items:
172-
- id: CQ-01
173-
name: KISS Structure
174-
score: 3
175-
max: 3
176-
passed: true
177-
comment: 'Linear flow: imports → data → setup → plot → save'
178-
- id: CQ-02
179-
name: Reproducibility
180-
score: 2
181-
max: 3
182-
passed: false
183-
comment: No random seed, but data is deterministic (hardcoded values), minor
184-
deduction for not including np.random.seed(42) even though not strictly
185-
needed
186-
- id: CQ-03
187-
name: Clean Imports
188-
score: 2
189-
max: 2
190-
passed: true
191-
comment: 'All imports used: matplotlib, numpy, pandas, seaborn'
192-
- id: CQ-04
193-
name: No Deprecated API
194-
score: 1
195-
max: 1
196-
passed: true
197-
comment: Uses current seaborn 0.13+ API
198-
- id: CQ-05
199-
name: Output Correct
200-
score: 1
201-
max: 1
202-
passed: true
203-
comment: Saves as plot.png with dpi=300
204-
library_features:
205-
score: 3
206-
max: 5
207-
items:
208-
- id: LF-01
209-
name: Uses distinctive library features
210-
score: 3
211-
max: 5
212-
passed: false
213-
comment: Uses sns.set_theme() and sns.scatterplot() for data points, plus
214-
colorblind palette. However, radar charts are not a seaborn specialty -
215-
the implementation correctly falls back to matplotlib polar projection for
216-
the core chart while leveraging seaborn for styling and the data point markers
217-
verdict: APPROVED
20+
strengths: []
21+
weaknesses: []

0 commit comments

Comments
 (0)