Skip to content

Commit 450d725

Browse files
feat(seaborn): implement line-styled (#2610)
## Implementation: `line-styled` - seaborn Implements the **seaborn** version of `line-styled`. **File:** `plots/line-styled/implementations/seaborn.py` --- :robot: *[impl-generate workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20594555070)* --------- 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 8d38ae5 commit 450d725

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
""" pyplots.ai
2+
line-styled: Styled Line Plot
3+
Library: seaborn 0.13.2 | Python 3.13.11
4+
Quality: 94/100 | Created: 2025-12-30
5+
"""
6+
7+
import matplotlib.pyplot as plt
8+
import numpy as np
9+
import seaborn as sns
10+
11+
12+
# Data - Temperature trends across seasons
13+
np.random.seed(42)
14+
months = np.arange(1, 13)
15+
month_names = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
16+
17+
# Temperature patterns for different regions (°C)
18+
base_temp = np.array([5, 7, 12, 16, 21, 25, 28, 27, 23, 17, 11, 6])
19+
coastal = base_temp + np.random.randn(12) * 0.5 + 3
20+
continental = base_temp + np.random.randn(12) * 0.5 - 2
21+
mountain = base_temp + np.random.randn(12) * 0.5 - 8
22+
mediterranean = base_temp + np.random.randn(12) * 0.5 + 5
23+
24+
# Plot
25+
fig, ax = plt.subplots(figsize=(16, 9))
26+
sns.set_style("whitegrid")
27+
28+
# Line styles: solid, dashed, dotted, dashdot
29+
line_styles = ["-", "--", ":", "-."]
30+
colors = ["#306998", "#FFD43B", "#2E8B57", "#DC143C"]
31+
labels = ["Coastal", "Continental", "Mountain", "Mediterranean"]
32+
data_series = [coastal, continental, mountain, mediterranean]
33+
34+
for data, label, ls, color in zip(data_series, labels, line_styles, colors, strict=True):
35+
sns.lineplot(x=months, y=data, ax=ax, linestyle=ls, linewidth=3.5, color=color, label=label)
36+
37+
# Styling
38+
ax.set_xlabel("Month", fontsize=20)
39+
ax.set_ylabel("Temperature (°C)", fontsize=20)
40+
ax.set_title("line-styled · seaborn · pyplots.ai", fontsize=24)
41+
ax.tick_params(axis="both", labelsize=16)
42+
ax.set_xticks(months)
43+
ax.set_xticklabels(month_names, fontsize=14)
44+
ax.legend(fontsize=16, loc="upper right", framealpha=0.9)
45+
ax.grid(True, alpha=0.3, linestyle="--")
46+
47+
plt.tight_layout()
48+
plt.savefig("plot.png", dpi=300, bbox_inches="tight")
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
library: seaborn
2+
specification_id: line-styled
3+
created: '2025-12-30T10:37:42Z'
4+
updated: '2025-12-30T10:44:16Z'
5+
generated_by: claude-opus-4-5-20251101
6+
workflow_run: 20594555070
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/line-styled/seaborn/plot.png
11+
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/line-styled/seaborn/plot_thumb.png
12+
preview_html: null
13+
quality_score: 94
14+
review:
15+
strengths:
16+
- Excellent use of all four standard line styles (solid, dashed, dotted, dash-dot)
17+
clearly differentiating the series
18+
- Realistic temperature data context with appropriate seasonal patterns across different
19+
climate regions
20+
- Clean, readable code following KISS principles with proper seed for reproducibility
21+
- Good font sizing throughout meeting the 4800×2700 target resolution requirements
22+
- Proper title format and axis labels with units
23+
weaknesses:
24+
- Could leverage seaborn native palette system instead of manually specifying colors
25+
- Data context is generic (Coastal, Continental) rather than specific real-world
26+
regions

0 commit comments

Comments
 (0)