{"spec_id":"wireframe-3d-basic","library":"seaborn","language":"python","code":"\"\"\" anyplot.ai\nwireframe-3d-basic: Basic 3D Wireframe Plot\nLibrary: seaborn 0.13.2 | Python 3.13.14\nQuality: 83/100 | Updated: 2026-08-04\n\"\"\"\n\nimport sys\n\n\nsys.path = [p for p in sys.path if \"implementations/python\" not in p and p not in (\"\", \".\")]\n\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nfrom matplotlib.colors import LinearSegmentedColormap\n\n\n# Theme tokens\nTHEME = os.getenv(\"ANYPLOT_THEME\", \"light\")\nPAGE_BG = \"#FAF8F1\" if THEME == \"light\" else \"#1A1A17\"\nINK = \"#1A1A17\" if THEME == \"light\" else \"#F0EFE8\"\nINK_SOFT = \"#4A4A44\" if THEME == \"light\" else \"#B8B7B0\"\nBRAND = \"#009E73\"\n\nsns.set_theme(\n    style=\"ticks\",\n    rc={\n        \"figure.facecolor\": PAGE_BG,\n        \"axes.facecolor\": PAGE_BG,\n        \"axes.edgecolor\": INK_SOFT,\n        \"axes.labelcolor\": INK,\n        \"text.color\": INK,\n        \"xtick.color\": INK_SOFT,\n        \"ytick.color\": INK_SOFT,\n    },\n)\n\n# Imprint sequential colormap (brand green -> blue) for height-based shading\nimprint_seq = LinearSegmentedColormap.from_list(\"imprint_seq\", [BRAND, \"#4467A3\"])\n\n# Data - terrain ripple surface (24x24 keeps the mesh legible at the central peak)\nnp.random.seed(42)\nx = np.linspace(-5, 5, 24)\ny = np.linspace(-5, 5, 24)\nX, Y = np.meshgrid(x, y)\nR = np.sqrt(X**2 + Y**2)\nZ = np.sin(R)\n\n# Plot\nfig = plt.figure(figsize=(8, 4.5), dpi=400)\nfig.patch.set_facecolor(PAGE_BG)\nax = fig.add_subplot(111, projection=\"3d\", facecolor=PAGE_BG)\nax.set_box_aspect((1.3, 1.3, 0.8))\n\n# Faint height-mapped surface for depth cues, crisp wireframe on top for structure\nax.plot_surface(X, Y, Z, cmap=imprint_seq, alpha=0.35, linewidth=0, antialiased=True, shade=False)\nax.plot_wireframe(X, Y, Z, color=BRAND, linewidth=1.0, alpha=0.9, antialiased=True)\n\n# Style\nax.set_xlabel(\"Distance East (m)\", fontsize=13, color=INK, labelpad=8)\nax.set_ylabel(\"Distance North (m)\", fontsize=13, color=INK, labelpad=8)\nax.set_zlabel(\"Terrain Elevation (m)\", fontsize=13, color=INK, labelpad=8)\nax.set_title(\"wireframe-3d-basic · python · seaborn · anyplot.ai\", fontsize=15, fontweight=\"medium\", color=INK, pad=14)\n\n# Tick styling\nax.tick_params(axis=\"x\", labelsize=10, colors=INK_SOFT)\nax.tick_params(axis=\"y\", labelsize=10, colors=INK_SOFT)\nax.tick_params(axis=\"z\", labelsize=10, colors=INK_SOFT)\n\n# Perspective: elevation angle emphasizes surface topology\nax.view_init(elev=25, azim=45)\nax.grid(True, alpha=0.08, linewidth=0.6, color=INK_SOFT)\n\n# Pane styling: minimize edges for cleaner appearance\nax.xaxis.pane.set_facecolor(PAGE_BG)\nax.yaxis.pane.set_facecolor(PAGE_BG)\nax.zaxis.pane.set_facecolor(PAGE_BG)\nfor pane in [ax.xaxis.pane, ax.yaxis.pane, ax.zaxis.pane]:\n    pane.set_edgecolor(\"none\")\n    pane.set_alpha(0.0)\n\n# Tighten margins so the mesh fills more of the 3200x1800 canvas\nfig.subplots_adjust(left=0.02, right=0.98, top=0.88, bottom=0.04)\n\n# Save — bbox_inches must stay default (None); \"tight\" silently trims the canvas\nplt.savefig(f\"plot-{THEME}.png\", dpi=400, facecolor=PAGE_BG, edgecolor=\"none\")\n"}