Skip to content

Commit 003d59b

Browse files
feat(seaborn): implement surface-basic (#1305)
## Implementation: `surface-basic` - seaborn Implements the **seaborn** version of `surface-basic`. **File:** `plots/surface-basic/implementations/seaborn.py` **Parent Issue:** #1013 --- :robot: *[impl-generate workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20304611493)* --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1d86a2f commit 003d59b

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"""
2+
surface-basic: Basic 3D Surface Plot
3+
Library: seaborn
4+
"""
5+
6+
import matplotlib.pyplot as plt
7+
import numpy as np
8+
import seaborn as sns
9+
10+
11+
# Set seaborn style for better aesthetics
12+
sns.set_theme(style="whitegrid")
13+
14+
# Data - create a 40x40 grid for smooth visualization
15+
x = np.linspace(-4, 4, 40)
16+
y = np.linspace(-4, 4, 40)
17+
X, Y = np.meshgrid(x, y)
18+
19+
# Gaussian-like surface with interesting features
20+
Z = np.sin(np.sqrt(X**2 + Y**2)) * np.exp(-0.1 * (X**2 + Y**2))
21+
22+
# Create 3D plot (4800x2700 px)
23+
fig = plt.figure(figsize=(16, 9))
24+
ax = fig.add_subplot(111, projection="3d")
25+
26+
# Plot surface with colormap
27+
surf = ax.plot_surface(X, Y, Z, cmap="viridis", edgecolor="none", alpha=0.9, antialiased=True)
28+
29+
# Add colorbar to show value scale
30+
cbar = fig.colorbar(surf, ax=ax, shrink=0.5, aspect=10, pad=0.1)
31+
cbar.set_label("Z Value", fontsize=16)
32+
cbar.ax.tick_params(labelsize=12)
33+
34+
# Labels and styling (scaled font sizes for 4800x2700)
35+
ax.set_xlabel("X Axis", fontsize=18, labelpad=12)
36+
ax.set_ylabel("Y Axis", fontsize=18, labelpad=12)
37+
ax.set_zlabel("Z Axis", fontsize=18, labelpad=12)
38+
ax.set_title("surface-basic · seaborn · pyplots.ai", fontsize=24, pad=20)
39+
40+
# Tick parameters
41+
ax.tick_params(axis="both", labelsize=14)
42+
43+
# Set viewing angle for good perspective
44+
ax.view_init(elev=30, azim=45)
45+
46+
plt.tight_layout()
47+
plt.savefig("plot.png", dpi=300, bbox_inches="tight")
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Per-library metadata for seaborn implementation of surface-basic
2+
# Auto-generated by impl-generate.yml
3+
4+
library: seaborn
5+
specification_id: surface-basic
6+
7+
# Preview URLs (filled by workflow)
8+
preview_url: https://storage.googleapis.com/pyplots-images/plots/surface-basic/seaborn/plot.png
9+
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/surface-basic/seaborn/plot_thumb.png
10+
preview_html: null
11+
12+
current:
13+
version: 0
14+
generated_at: 2025-12-17T13:36:25Z
15+
generated_by: claude-opus-4-5-20251101
16+
workflow_run: 20304611493
17+
issue: 1013
18+
quality_score: 92
19+
# Version info (filled by workflow)
20+
python_version: "3.13.11"
21+
library_version: "unknown"
22+
23+
history: []

0 commit comments

Comments
 (0)