{"spec_id":"radar-multi","library":"makie","language":"julia","code":"# anyplot.ai\n# radar-multi: Multi-Series Radar Chart\n# Library: makie 0.21.9 | Julia 1.11.9\n# Quality: 88/100 | Updated: 2026-08-18\n\nusing CairoMakie\nusing Colors\n\n# --- Theme tokens -------------------------------------------------------------\nconst THEME    = get(ENV, \"ANYPLOT_THEME\", \"light\")\nconst PAGE_BG  = THEME == \"light\" ? colorant\"#FAF8F1\" : colorant\"#1A1A17\"\nconst INK      = THEME == \"light\" ? colorant\"#1A1A17\" : colorant\"#F0EFE8\"\nconst INK_SOFT = THEME == \"light\" ? colorant\"#4A4A44\" : colorant\"#B8B7B0\"\nconst INK_MUTED = THEME == \"light\" ? colorant\"#6B6A63\" : colorant\"#A8A79F\"\n\n# Imprint categorical palette — 8 hues, theme-independent, hybrid-v3 sort\nconst IMPRINT_PALETTE = [\n    colorant\"#009E73\", colorant\"#C475FD\", colorant\"#4467A3\", colorant\"#BD8233\",\n    colorant\"#AE3030\", colorant\"#2ABCCD\", colorant\"#954477\", colorant\"#99B314\",\n]\n\n# --- Data: skill assessment across three roles ---------------------------------\ncategories = [\"Communication\", \"Technical Skill\", \"Leadership\",\n              \"Creativity\", \"Problem Solving\", \"Time Management\"]\nseries_names = [\"Senior Engineer\", \"Team Lead\", \"New Hire\"]\nscores = [\n    82.0 90.0 60.0   # Communication\n    95.0 78.0 55.0   # Technical Skill\n    65.0 92.0 30.0   # Leadership\n    70.0 75.0 68.0   # Creativity\n    88.0 80.0 62.0   # Problem Solving\n    75.0 85.0 58.0   # Time Management\n]\n\nn_axes = length(categories)\nangles = [pi / 2 - 2pi * (i - 1) / n_axes for i in 1:n_axes]\nmax_value = 100.0\nring_values = 20:20:100\n\n# --- Plot -----------------------------------------------------------------------\nfig = Figure(resolution = (1200, 1200), fontsize = 14, backgroundcolor = PAGE_BG)\n\nax = Axis(\n    fig[1, 1];\n    title           = \"radar-multi · julia · makie · anyplot.ai\",\n    titlesize       = 31,\n    titlecolor      = INK,\n    backgroundcolor = PAGE_BG,\n    aspect          = DataAspect(),\n)\nhidedecorations!(ax)\nhidespines!(ax)\nlimits!(ax, -140, 140, -140, 140)\n\n# Concentric reference rings for value gridlines\nfor ring in ring_values\n    ring_x = [ring * cos(a) for a in angles]\n    ring_y = [ring * sin(a) for a in angles]\n    push!(ring_x, ring_x[1])\n    push!(ring_y, ring_y[1])\n    lines!(ax, ring_x, ring_y; color = (INK, 0.15), linewidth = 1.2)\nend\n\n# Spokes from center to each category axis\nfor a in angles\n    lines!(ax, [0.0, max_value * cos(a)], [0.0, max_value * sin(a)];\n           color = (INK_SOFT, 0.5), linewidth = 1.0)\nend\n\n# Radial value labels placed in the empty sector between the first two axes\nlabel_angle = (angles[1] + angles[2]) / 2\nfor ring in ring_values[1:(end - 1)]\n    text!(ax, ring * cos(label_angle), ring * sin(label_angle);\n          text = string(Int(ring)), color = INK_MUTED, fontsize = 14,\n          align = (:center, :center))\nend\n\n# Category labels at the outer edge\nfor (i, category) in enumerate(categories)\n    a = angles[i]\n    label_x, label_y = 118 * cos(a), 118 * sin(a)\n    halign = cos(a) > 0.15 ? :left : (cos(a) < -0.15 ? :right : :center)\n    valign = sin(a) > 0.15 ? :bottom : (sin(a) < -0.15 ? :top : :center)\n    text!(ax, label_x, label_y; text = category, color = INK, fontsize = 17,\n          align = (halign, valign))\nend\n\n# Series polygons — filled with transparency, outlined, and vertex-marked.\n# scatterlines! draws the stroke+marker vertices and connecting outline in a\n# single Makie recipe call (matplotlib needs two separate calls for this).\nfor (s, series) in enumerate(series_names)\n    values = scores[:, s]\n    vertex_x = [values[i] * cos(angles[i]) for i in 1:n_axes]\n    vertex_y = [values[i] * sin(angles[i]) for i in 1:n_axes]\n    color = IMPRINT_PALETTE[s]\n\n    poly!(ax, Point2f.(vertex_x, vertex_y); color = (color, 0.22), strokewidth = 0)\n    closed_x, closed_y = vcat(vertex_x, vertex_x[1]), vcat(vertex_y, vertex_y[1])\n    scatterlines!(ax, closed_x, closed_y; color = color, linewidth = 3,\n                  markersize = 10, strokewidth = 1.5, strokecolor = PAGE_BG,\n                  label = series)\nend\n\naxislegend(ax; position = :rb, framevisible = false, labelcolor = INK,\n           labelsize = 14, backgroundcolor = (PAGE_BG, 0.0))\n\n# --- Save -------------------------------------------------------------------\nsave(\"plot-$(THEME).png\", fig; px_per_unit = 2)\n"}