Skip to content

Commit ecf3c1c

Browse files
feat(seaborn): implement cat-strip (#2697)
## Implementation: `cat-strip` - seaborn Implements the **seaborn** version of `cat-strip`. **File:** `plots/cat-strip/implementations/seaborn.py` --- :robot: *[impl-generate workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20596058931)* --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 58579ea commit ecf3c1c

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
""" pyplots.ai
2+
cat-strip: Categorical Strip Plot
3+
Library: seaborn 0.13.2 | Python 3.13.11
4+
Quality: 92/100 | Created: 2025-12-30
5+
"""
6+
7+
import matplotlib.pyplot as plt
8+
import numpy as np
9+
import pandas as pd
10+
import seaborn as sns
11+
12+
13+
# Data - Product quality scores across manufacturing lines
14+
np.random.seed(42)
15+
16+
categories = ["Line A", "Line B", "Line C", "Line D", "Line E"]
17+
n_per_category = 25
18+
19+
data = []
20+
for cat in categories:
21+
if cat == "Line A":
22+
values = np.random.normal(85, 5, n_per_category)
23+
elif cat == "Line B":
24+
values = np.random.normal(78, 8, n_per_category)
25+
elif cat == "Line C":
26+
values = np.random.normal(92, 3, n_per_category)
27+
elif cat == "Line D":
28+
values = np.random.normal(75, 10, n_per_category)
29+
else:
30+
values = np.random.normal(88, 6, n_per_category)
31+
32+
for v in values:
33+
data.append({"Manufacturing Line": cat, "Quality Score": v})
34+
35+
df = pd.DataFrame(data)
36+
37+
# Plot
38+
fig, ax = plt.subplots(figsize=(16, 9))
39+
40+
sns.stripplot(
41+
data=df,
42+
x="Manufacturing Line",
43+
y="Quality Score",
44+
hue="Manufacturing Line",
45+
palette=["#306998", "#FFD43B", "#4B8BBE", "#646464", "#F0DB4F"],
46+
size=12,
47+
jitter=0.25,
48+
alpha=0.8,
49+
ax=ax,
50+
legend=False,
51+
)
52+
53+
# Style
54+
ax.set_title("cat-strip · seaborn · pyplots.ai", fontsize=24, fontweight="bold", pad=20)
55+
ax.set_xlabel("Manufacturing Line", fontsize=20)
56+
ax.set_ylabel("Quality Score", fontsize=20)
57+
ax.tick_params(axis="both", labelsize=16)
58+
ax.grid(True, axis="y", alpha=0.3, linestyle="--")
59+
60+
# Set y-axis range to show full data
61+
ax.set_ylim(45, 105)
62+
63+
plt.tight_layout()
64+
plt.savefig("plot.png", dpi=300, bbox_inches="tight")
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
library: seaborn
2+
specification_id: cat-strip
3+
created: '2025-12-30T12:04:59Z'
4+
updated: '2025-12-30T12:07:53Z'
5+
generated_by: claude-opus-4-5-20251101
6+
workflow_run: 20596058931
7+
issue: 0
8+
python_version: 3.13.11
9+
library_version: 0.13.2
10+
preview_url: https://storage.googleapis.com/pyplots-images/plots/cat-strip/seaborn/plot.png
11+
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/cat-strip/seaborn/plot_thumb.png
12+
preview_html: null
13+
quality_score: 92
14+
review:
15+
strengths:
16+
- Excellent use of seaborn modern API with hue parameter to avoid deprecation warnings
17+
- Clear visual differentiation between manufacturing lines with distinct colors
18+
- Data demonstrates variety in distributions (tight clustering in Line C vs wide
19+
spread in Line D)
20+
- Professional title format and appropriate font sizing throughout
21+
- Good use of jitter (0.25) to show individual points without excessive spread
22+
weaknesses:
23+
- Axis labels lack units (Quality Score could specify scale like 0-100)
24+
- Two yellow shades (Line B, Line E) are somewhat similar - could use more distinct
25+
palette like colorblind
26+
- Does not showcase advanced seaborn features like overlaying with boxplot or using
27+
built-in palettes
28+
- Some data points exceed 100 which is unusual for a score metric

0 commit comments

Comments
 (0)