--- name: figure description: Hybrid figure pipeline (Nano Banana raster + rembg background removal + TikZ vector assembly). Includes a TikZ template library covering quantum circuits (quantikz), Feynman diagrams (tikz-feynman), circuits (circuitikz), molecules (chemfig), 2D/3D plots (pgfplots), energy-level diagrams, phase-space trajectories, optical setups, and pulse sequences. Use this skill to produce publication-quality figures with perfect LaTeX symbol rendering and agent-friendly iteration. compatibility: Requires pdflatex + pdftoppm on PATH. Python 3.10+ with google-genai, rembg[cpu], Pillow. GEMINI_API_KEY env var for raster generation. allowed-tools: Bash(python:*) Bash(pdflatex:*) Bash(pdftoppm:*) Bash(pdfimages:*) --- # Figure Skill Publication-quality figures via the hybrid pipeline: let Gemini (Nano Banana) render photorealistic / textured / 3D components, let TikZ own all symbols, arrows, labels, equations, and layout. You get the visual richness of AI rendering AND the precision of code. ## When to use which backend ``` ┌─────────────────────────────────────────────────────────────────┐ │ What are you drawing? │ Backend │ ├─────────────────────────────────────────────────┼───────────────┤ │ Data plot (lines, bars, heatmaps from data) │ pgfplots │ │ Quantum circuit (Hadamard, CNOT, measure) │ quantikz │ │ Feynman diagram │ feynman │ │ Molecule / Lewis structure │ chemfig │ │ Electronic circuit (op-amp, RLC) │ circuitikz │ │ Atomic energy levels + transitions │ energy_levels │ │ Phase-space trajectory │ phase_space │ │ Pulse sequence (NMR / qubit timing) │ pulse_sequence│ │ Optical bench cartoon (2D, flat) │ optical_setup │ │ Concept schematic with textured 3D objects │ HYBRID │ │ (Paul trap, cavity, apparatus, animal etc.) │ │ └─────────────────────────────────────────────────────────────────┘ ``` For HYBRID, pick raster components sparingly: only for textured / 3D / glossy objects where TikZ would take 50+ lines of patches. Everything else → TikZ. ## The hybrid pipeline ``` 1. decide which elements are raster (3D/textured/glossy) vs vector (everything else) 2. for each raster element: python skills/figure/scripts/hybrid_gen.py \ --name --prompt "" --style "