Closed
Description
As shown by #11094 #12612 matplotlib is used inside of webservers to dynamically serve plots. The example should show:
- importance of picking a non-GUI backend (both by setting the backend and explicitly by not using pyplot). Given that these servers are multi-threaded, not using pyplot at all may be the best option to avoid any coupling between workers via pyplot and memory leaks due to pyplot holding references to figures forever. Should probably show use of
new_figure_manager
- saving to a bytesIO buffer to avoid disk
- png, svg, and pdf
- be applicable to both django and flask (not sure off the top of my head what the differences are), bonus points for cherrypy, aiohttp, tornado, and pyramid