{"spec_id":"radar-basic","library":"matplotlib","language":"python","code":"\"\"\" anyplot.ai\nradar-basic: Basic Radar Chart\nLibrary: matplotlib 3.11.1 | Python 3.13.14\nQuality: 84/100 | Updated: 2026-07-24\n\"\"\"\n\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\n# Theme\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\"\n\nSERIES_1 = \"#009E73\"  # Imprint palette position 1\nSERIES_2 = \"#C475FD\"  # Imprint palette position 2\n\n# Data - Employee performance comparison across six competencies\ncategories = [\"Communication\", \"Technical Skills\", \"Teamwork\", \"Problem Solving\", \"Leadership\", \"Creativity\"]\nsenior_dev = [82, 94, 75, 90, 48, 78]  # Strong technical, weaker leadership\nteam_lead = [88, 55, 96, 62, 91, 70]  # Strong people skills, weaker technical\n\nnum_vars = len(categories)\nangles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist()\n\nsenior_dev_closed = senior_dev + [senior_dev[0]]\nteam_lead_closed = team_lead + [team_lead[0]]\nangles_closed = angles + [angles[0]]\n\n# Plot\nfig, ax = plt.subplots(figsize=(6, 6), dpi=400, subplot_kw={\"polar\": True}, facecolor=PAGE_BG)\nax.set_facecolor(PAGE_BG)\n\n# Start from top (12 o'clock), go clockwise\nax.set_theta_offset(np.pi / 2)\nax.set_theta_direction(-1)\n\n# Alternating radial bands for subtle depth (design polish beyond flat gridlines)\nring_edges = [0, 20, 40, 60, 80, 100]\ntheta_full = np.linspace(0, 2 * np.pi, 200)\nfor i in range(len(ring_edges) - 1):\n    if i % 2 == 1:\n        ax.fill_between(theta_full, ring_edges[i], ring_edges[i + 1], color=INK, alpha=0.04, zorder=0)\n\n# Senior Developer\nax.fill(angles_closed, senior_dev_closed, color=SERIES_1, alpha=0.25, zorder=2)\nax.plot(\n    angles_closed,\n    senior_dev_closed,\n    color=SERIES_1,\n    linewidth=3,\n    marker=\"o\",\n    markersize=10,\n    markeredgecolor=PAGE_BG,\n    markeredgewidth=1.5,\n    label=\"Senior Developer\",\n    zorder=3,\n)\n\n# Team Lead\nax.fill(angles_closed, team_lead_closed, color=SERIES_2, alpha=0.25, zorder=2)\nax.plot(\n    angles_closed,\n    team_lead_closed,\n    color=SERIES_2,\n    linewidth=3,\n    marker=\"o\",\n    markersize=10,\n    markeredgecolor=PAGE_BG,\n    markeredgewidth=1.5,\n    label=\"Team Lead\",\n    zorder=3,\n)\n\n# Axis configuration\nax.set_xticks(angles)\nax.set_xticklabels(categories, fontsize=18, color=INK)\n\n# Extend past 100 so category labels clear the outer data ring with margin;\n# gridlines/ticks stay capped at 100 to match the spec's 20/40/60/80/100 scale\nax.set_ylim(0, 118)\nax.set_yticks([20, 40, 60, 80, 100])\nax.set_rlabel_position(22.5)\nax.set_yticklabels([\"20\", \"40\", \"60\", \"80\", \"100\"], fontsize=16, color=INK_MUTED)\n\n# Grid and outer spine\nax.grid(True, alpha=0.18, linewidth=1.0, color=INK)\nax.spines[\"polar\"].set_color(INK_SOFT)\nax.spines[\"polar\"].set_linewidth(0.8)\n\n# Title\ntitle = \"Employee Performance · radar-basic · matplotlib · anyplot.ai\"\ntitle_fontsize = max(8, round(12 * 67 / len(title))) if len(title) > 67 else 12\nax.set_title(title, fontsize=title_fontsize, fontweight=\"medium\", pad=28, color=INK)\n\n# Legend\nleg = ax.legend(loc=\"lower center\", bbox_to_anchor=(0.5, -0.2), fontsize=16, ncol=2)\nleg.get_frame().set_facecolor(ELEVATED_BG)\nleg.get_frame().set_edgecolor(INK_SOFT)\nplt.setp(leg.get_texts(), color=INK_SOFT)\n\nfig.subplots_adjust(left=0.12, right=0.84, top=0.88, bottom=0.16)\nplt.savefig(f\"plot-{THEME}.png\", dpi=400, facecolor=PAGE_BG)\n"}