{"spec_id":"line-markers","library":"matplotlib","language":"python","code":"\"\"\" anyplot.ai\nline-markers: Line Plot with Markers\nLibrary: matplotlib 3.10.9 | Python 3.13.13\nQuality: 75/100 | Updated: 2026-05-12\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\n# Data - Temperature readings over 14 days from weather stations\nnp.random.seed(42)\ndays = np.arange(1, 15)\n\n# Station A: Coastal location (moderate, stable)\nstation_a = 18 + np.cumsum(np.random.randn(14) * 0.8)\n\n# Station B: Inland location (more variable)\nstation_b = 15 + np.cumsum(np.random.randn(14) * 1.2)\n\n# Station C: Mountain location (cooler, different pattern)\nstation_c = 10 + np.cumsum(np.random.randn(14) * 1.0)\n\n# Create plot\nfig, ax = plt.subplots(figsize=(16, 9))\n\n# Plot lines with different marker styles\nax.plot(\n    days,\n    station_a,\n    marker=\"o\",\n    markersize=12,\n    linewidth=3,\n    color=\"#306998\",\n    label=\"Coastal Station\",\n    markeredgecolor=\"white\",\n    markeredgewidth=2,\n)\n\nax.plot(\n    days,\n    station_b,\n    marker=\"s\",\n    markersize=12,\n    linewidth=3,\n    color=\"#FFD43B\",\n    label=\"Inland Station\",\n    markeredgecolor=\"white\",\n    markeredgewidth=2,\n)\n\nax.plot(\n    days,\n    station_c,\n    marker=\"^\",\n    markersize=12,\n    linewidth=3,\n    color=\"#E74C3C\",\n    label=\"Mountain Station\",\n    markeredgecolor=\"white\",\n    markeredgewidth=2,\n)\n\n# Labels and styling\nax.set_xlabel(\"Day\", fontsize=20)\nax.set_ylabel(\"Temperature (°C)\", fontsize=20)\nax.set_title(\"line-markers · matplotlib · pyplots.ai\", fontsize=24)\nax.tick_params(axis=\"both\", labelsize=16)\nax.grid(True, alpha=0.3, linestyle=\"--\")\nax.legend(fontsize=16, loc=\"best\")\n\n# Set x-axis to show all days\nax.set_xticks(days)\n\nplt.tight_layout()\nplt.savefig(\"plot.png\", dpi=300, bbox_inches=\"tight\")\n"}