{"spec_id":"line-basic","library":"matplotlib","language":"python","code":"\"\"\" anyplot.ai\nline-basic: Basic Line Plot\nLibrary: matplotlib 3.10.9 | Python 3.13.13\nQuality: 91/100 | Updated: 2026-04-29\n\"\"\"\n\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\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\"\nINK_MUTED = \"#6B6A63\" if THEME == \"light\" else \"#A8A79F\"\nBRAND = \"#009E73\"\n\n# Data - Average monthly temperature across 5 simulated years\nnp.random.seed(42)\nmonths = np.arange(1, 13)\nbase_temp = 15 + 12 * np.sin((months - 4) * np.pi / 6)\nall_years = base_temp + np.random.randn(5, 12) * 2.5\nmean_temp = all_years.mean(axis=0)\nstd_temp = all_years.std(axis=0)\n\n# Plot\nfig, ax = plt.subplots(figsize=(16, 9), facecolor=PAGE_BG)\nax.set_facecolor(PAGE_BG)\n\n# Year-to-year variability band\nax.fill_between(months, mean_temp - std_temp, mean_temp + std_temp, color=BRAND, alpha=0.15, linewidth=0)\n\n# Mean temperature line with markers\nax.plot(\n    months,\n    mean_temp,\n    linewidth=3,\n    color=BRAND,\n    marker=\"o\",\n    markersize=10,\n    markerfacecolor=PAGE_BG,\n    markeredgecolor=BRAND,\n    markeredgewidth=2,\n)\n\n# Style\nmonth_labels = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\nax.set_xticks(months)\nax.set_xticklabels(month_labels)\nax.tick_params(axis=\"both\", labelsize=16, labelcolor=INK_SOFT, length=0)\n\nax.set_xlabel(\"Month\", fontsize=20, color=INK)\nax.set_ylabel(\"Temperature (°C)\", fontsize=20, color=INK)\nax.set_title(\n    \"Monthly Temperature Trend · line-basic · matplotlib · anyplot.ai\", fontsize=24, fontweight=\"medium\", color=INK\n)\n\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)\n\nax.yaxis.grid(True, alpha=0.12, linewidth=0.8, color=INK)\n\nplt.tight_layout()\nplt.savefig(f\"plot-{THEME}.png\", dpi=300, bbox_inches=\"tight\", facecolor=PAGE_BG)\n"}