Write canonical example of how to use Matplotlib inside a webserver · Issue #12628 · matplotlib/matplotlib · GitHub
Skip to content

Write canonical example of how to use Matplotlib inside a webserver #12628

Description

@tacaswell

As shown by #11094 #12612 matplotlib is used inside of webservers to dynamically serve plots. The example should show:

  1. 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
  2. saving to a bytesIO buffer to avoid disk
  3. png, svg, and pdf
  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentation🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions