{"spec_id":"venn-labeled-items","library":"matplotlib","language":"python","code":"\"\"\" anyplot.ai\nvenn-labeled-items: Chartgeist-Style Venn Diagram with Labeled Items\nLibrary: matplotlib 3.11.0 | Python 3.13.14\nQuality: 85/100 | Updated: 2026-06-25\n\"\"\"\n\nimport os\n\nimport matplotlib.patheffects as pe\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Circle\n\n\n# Theme tokens\nTHEME = os.getenv(\"ANYPLOT_THEME\", \"light\")\nPAGE_BG = \"#FAF8F1\" if THEME == \"light\" else \"#1A1A17\"\nINK = \"#1A1A17\" if THEME == \"light\" else \"#F0EFE8\"\nINK_SOFT = \"#4A4A44\" if THEME == \"light\" else \"#B8B7B0\"\nINK_MUTED = \"#6B6A63\" if THEME == \"light\" else \"#A8A79F\"\n\n# Imprint palette — positions 1, 2, 3\nCOLOR_A = \"#009E73\"  # brand green — ALWAYS first series\nCOLOR_B = \"#C475FD\"  # lavender\nCOLOR_C = \"#4467A3\"  # blue\n\n# Data: three Chartgeist-style traits\nRADIUS = 1.5\ncircles = [\n    {\"name\": \"Overhyped\", \"center\": (-0.85, 0.50), \"color\": COLOR_A},\n    {\"name\": \"Actually Useful\", \"center\": (0.85, 0.50), \"color\": COLOR_B},\n    {\"name\": \"Secretly Loved\", \"center\": (0.00, -1.00), \"color\": COLOR_C},\n]\n\n# Items placed inside their assigned zone (label, x, y)\nitems = [\n    # A only — Overhyped\n    (\"NFTs\", -2.05, 1.05),\n    (\"Metaverse\", -2.10, 0.55),\n    (\"Smart Fridges\", -2.00, 0.05),\n    # B only — Actually Useful\n    (\"Google Maps\", 2.05, 1.05),\n    (\"Spreadsheets\", 2.10, 0.55),\n    (\"Calendar Apps\", 2.00, 0.05),\n    # C only — Secretly Loved\n    (\"Roller Skating\", -0.65, -2.25),\n    (\"Soap Operas\", 0.65, -1.80),\n    # A ∩ B\n    (\"ChatGPT\", 0.00, 1.20),\n    (\"Smartwatches\", 0.00, 0.85),\n    # A ∩ C\n    (\"Crocs\", -1.10, -0.20),\n    (\"Vinyl Records\", -1.05, -0.60),\n    # B ∩ C\n    (\"Dolly Parton\", 1.10, -0.20),\n    (\"Spotify\", 1.05, -0.60),\n    # A ∩ B ∩ C\n    (\"Sourdough\", 0.00, 0.12),\n    (\"TikTok\", 0.00, -0.32),\n]\n\n# Plot — square 2400 × 2400 px (symmetric Venn diagram)\nfig, ax = plt.subplots(figsize=(6, 6), dpi=400, facecolor=PAGE_BG)\nax.set_facecolor(PAGE_BG)\n\n# Three overlapping circles with semi-transparent Imprint palette fills\nfor circle in circles:\n    ax.add_patch(\n        Circle(\n            circle[\"center\"],\n            RADIUS,\n            facecolor=circle[\"color\"],\n            alpha=0.22,\n            edgecolor=circle[\"color\"],\n            linewidth=2.5,\n            zorder=1,\n        )\n    )\n\n# Item labels with knockout stroke so text stays readable inside colored overlap regions\nfor label, x, y in items:\n    txt = ax.text(x, y, label, fontsize=10, color=INK, ha=\"center\", va=\"center\", family=\"serif\", zorder=3)\n    txt.set_path_effects([pe.withStroke(linewidth=2.5, foreground=PAGE_BG)])\n\n# Category labels outside each circle, on its outer side\ncategory_positions = [\n    (\"Overhyped\", -2.55, 1.85, \"right\", COLOR_A),\n    (\"Actually Useful\", 2.55, 1.85, \"left\", COLOR_B),\n    (\"Secretly Loved\", 0.00, -2.85, \"center\", COLOR_C),\n]\nfor name, x, y, ha, color in category_positions:\n    ax.text(x, y, name, fontsize=12, color=color, ha=ha, va=\"center\", family=\"serif\", fontweight=\"bold\", zorder=4)\n\n# Editorial title + canonical anyplot.ai attribution line\nax.text(\n    0,\n    3.05,\n    \"Chartgeist 2026\",\n    fontsize=16,\n    color=INK,\n    ha=\"center\",\n    va=\"center\",\n    family=\"serif\",\n    fontweight=\"bold\",\n    style=\"italic\",\n)\nax.text(\n    0,\n    2.55,\n    \"venn-labeled-items · python · matplotlib · anyplot.ai\",\n    fontsize=9,\n    color=INK_MUTED,\n    ha=\"center\",\n    va=\"center\",\n    family=\"serif\",\n)\n\n# Frame — clean gridless composition\nax.set_xlim(-3.5, 3.5)\nax.set_ylim(-3.2, 3.5)\nax.set_aspect(\"equal\")\nax.set_xticks([])\nax.set_yticks([])\nfor spine in ax.spines.values():\n    spine.set_visible(False)\n\nplt.tight_layout()\nplt.savefig(f\"plot-{THEME}.png\", dpi=400, facecolor=PAGE_BG)\nplt.close()\n"}