{"spec_id":"scatter-3d","library":"seaborn","language":"python","code":"\"\"\" anyplot.ai\nscatter-3d: 3D Scatter Plot\nLibrary: seaborn 0.13.2 | Python 3.13.13\nQuality: 93/100 | Created: 2026-05-08\n\"\"\"\n\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\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\n# Data\nnp.random.seed(42)\nn_points = 150\ncluster1_x = np.random.normal(-2, 0.8, n_points // 3)\ncluster1_y = np.random.normal(2, 0.8, n_points // 3)\ncluster1_z = np.random.normal(1, 0.8, n_points // 3)\n\ncluster2_x = np.random.normal(1, 0.8, n_points // 3)\ncluster2_y = np.random.normal(-1, 0.8, n_points // 3)\ncluster2_z = np.random.normal(3, 0.8, n_points // 3)\n\ncluster3_x = np.random.normal(2, 0.8, n_points - 2 * (n_points // 3))\ncluster3_y = np.random.normal(1, 0.8, n_points - 2 * (n_points // 3))\ncluster3_z = np.random.normal(-1, 0.8, n_points - 2 * (n_points // 3))\n\nx = np.concatenate([cluster1_x, cluster2_x, cluster3_x])\ny = np.concatenate([cluster1_y, cluster2_y, cluster3_y])\nz = np.concatenate([cluster1_z, cluster2_z, cluster3_z])\n\n# Plot\nfig = plt.figure(figsize=(16, 9), facecolor=PAGE_BG)\nax = fig.add_subplot(111, projection=\"3d\")\nax.set_facecolor(PAGE_BG)\n\nax.scatter(x, y, z, c=BRAND, s=200, alpha=0.7, edgecolors=PAGE_BG, linewidth=0.5)\n\n# Style\nax.set_xlabel(\"Feature A\", fontsize=20, color=INK, labelpad=10)\nax.set_ylabel(\"Feature B\", fontsize=20, color=INK, labelpad=10)\nax.set_zlabel(\"Feature C\", fontsize=20, color=INK, labelpad=10)\nax.set_title(\"scatter-3d · seaborn · anyplot.ai\", fontsize=24, fontweight=\"medium\", color=INK, pad=20)\n\nax.tick_params(axis=\"both\", labelsize=16, colors=INK_SOFT)\nax.xaxis.pane.set_facecolor(PAGE_BG)\nax.yaxis.pane.set_facecolor(PAGE_BG)\nax.zaxis.pane.set_facecolor(PAGE_BG)\nax.xaxis.pane.set_edgecolor(INK_SOFT)\nax.yaxis.pane.set_edgecolor(INK_SOFT)\nax.zaxis.pane.set_edgecolor(INK_SOFT)\n\nax.view_init(elev=20, azim=45)\n\nplt.tight_layout()\nplt.savefig(f\"plot-{THEME}.png\", dpi=300, bbox_inches=\"tight\", facecolor=PAGE_BG)\nplt.close()\n"}