New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write canonical example of how to use Matplotlib inside a webserver #12628
Comments
Rather than bothering with any explicit backend at all, I would strongly suggest merging #12450 and have the canonical approach be
Even with 3.0 (i.e. without that PR) new_figure_manager is totally overkill, just manually attaching a canvas ( |
Possible duplicate: #4124. |
Indeed! I'm going to close the older one. |
Do you want to make a decision about #12450, by the way? :) (as noted above) |
@tacaswell I think something like
is what you're looking for? |
My version was (stolen from a cookbook) fig = matplotlib.figure.Figure()
canvas = FigureCanvas(fig)
//plot to figure code
canvas.print_figure(response) where the outfile is the responsebuffer, like response = pyramid.response.Response(content_type='image/png') |
|
Yes, something as simple as that is what I had in mind. Agree on preferring |
Hi problem goes away really nicely using the AGG backend No need for the matplotlib GUI backend in the web server. Running on a Mac(High Sierra) with a Django server |
As shown by #11094 #12612 matplotlib is used inside of webservers to dynamically serve plots. The example should show:
new_figure_manager
The text was updated successfully, but these errors were encountered: