Closed picousse closed 5 years ago
This maybe?
ax, _ = graphic_record.plot(figure_width = 5)
output = io.BytesIO()
FigureCanvas(ax.figure).print_png(output)
return Response(output.getvalue(), mimetype='image/png')
Also have a look at these two functions I wrote to turn a figure into a base64 url string which you can send back to the client (it probably would work if you just put that in argument to Response
in your code)
ax, _ = graphic_record.plot(figure_width = 5)
data = matplotlib_figure_to_bitmap_base64_data(ax.figure, box_inches='tight')
return Response(data, mimetype='image/png')
Hi, Thanks a lot. I get some output! Now it is up to me for further tweaking.
Awesome stuff! and fast!
Hi, Cool lib. I wanted to use it in a webpage app using flask. However I'm a bit unsure how to embed this?
i've tried this:
but errors out:
any help/pointers what I should check?