{"spec_id":"line-styled","library":"seaborn","language":"python","code":"\"\"\" anyplot.ai\nline-styled: Styled Line Plot\nLibrary: seaborn 0.13.2 | Python 3.13.13\nQuality: 93/100 | Updated: 2026-05-12\n\"\"\"\n\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\n\n\n# Theme tokens\nTHEME = os.getenv(\"ANYPLOT_THEME\", \"light\")\nPAGE_BG = \"#FAF8F1\" if THEME == \"light\" else \"#1A1A17\"\nELEVATED_BG = \"#FFFDF6\" if THEME == \"light\" else \"#242420\"\nINK = \"#1A1A17\" if THEME == \"light\" else \"#F0EFE8\"\nINK_SOFT = \"#4A4A44\" if THEME == \"light\" else \"#B8B7B0\"\n\n# Okabe-Ito palette - first series always #009E73\nIMPRINT = [\"#009E73\", \"#C475FD\", \"#4467A3\", \"#BD8233\"]\n\n# Data - Temperature trends across seasons\nnp.random.seed(42)\nmonths = np.arange(1, 13)\nmonth_names = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n\n# Temperature patterns for different regions (°C)\nbase_temp = np.array([5, 7, 12, 16, 21, 25, 28, 27, 23, 17, 11, 6])\ncoastal = base_temp + np.random.randn(12) * 0.5 + 3\ncontinental = base_temp + np.random.randn(12) * 0.5 - 2\nmountain = base_temp + np.random.randn(12) * 0.5 - 8\nmediterranean = base_temp + np.random.randn(12) * 0.5 + 5\n\n# Plot\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        \"grid.color\": INK,\n        \"grid.alpha\": 0.10,\n        \"legend.facecolor\": ELEVATED_BG,\n        \"legend.edgecolor\": INK_SOFT,\n    },\n)\n\nfig, ax = plt.subplots(figsize=(16, 9), facecolor=PAGE_BG)\n\n# Line styles: solid, dashed, dotted, dashdot\nline_styles = [\"-\", \"--\", \":\", \"-.\"]\nlabels = [\"Coastal\", \"Continental\", \"Mountain\", \"Mediterranean\"]\ndata_series = [coastal, continental, mountain, mediterranean]\n\nfor data, label, ls, color in zip(data_series, labels, line_styles, IMPRINT, strict=True):\n    ax.plot(months, data, linestyle=ls, linewidth=3.5, color=color, label=label)\n\n# Styling\nax.set_xlabel(\"Month\", fontsize=20, color=INK)\nax.set_ylabel(\"Temperature (°C)\", fontsize=20, color=INK)\nax.set_title(\"line-styled · seaborn · anyplot.ai\", fontsize=24, fontweight=\"medium\", color=INK)\nax.tick_params(axis=\"both\", labelsize=16, colors=INK_SOFT)\nax.set_xticks(months)\nax.set_xticklabels(month_names, fontsize=14, color=INK_SOFT)\nax.yaxis.grid(True, alpha=0.10, linewidth=0.8, color=INK)\nax.spines[\"top\"].set_visible(False)\nax.spines[\"right\"].set_visible(False)\nfor s in (\"left\", \"bottom\"):\n    ax.spines[s].set_color(INK_SOFT)\nax.legend(fontsize=16, loc=\"upper right\", framealpha=0.95, facecolor=ELEVATED_BG, edgecolor=INK_SOFT)\n\nplt.tight_layout()\nplt.savefig(f\"plot-{THEME}.png\", dpi=300, bbox_inches=\"tight\", facecolor=PAGE_BG)\n"}