Server-Side Matplotlib with Agg: An Architecture Note for Headless Rendering
A practical architecture note for rendering Matplotlib figures in headless services: use the Agg backend and object-oriented API, avoid pyplot global state, close figures to bound memory, and verify output without a display.