I am trying to interactively display plots from matplotlib in django. From this answer, I see that I can send the plot from a view with this code:
response = HttpResponse(mimetype="image/png")
# create your image as usual, e.g. pylab.plot(...)
pylab.savefig(response, format="png")
return response
So the view sends the plot as an Httpresponse, but how do I reference that in the html code of the template? I'm guessing it will be something like this but am having a tough time finding examples of html code:
<img src={ some reference to the plot here }>
Again, I think I can generate the plot with a view but am not sure how to reference that output in the html template.
template_name = "app/plot.html"then the src for the plot will be that path? I'll try that. Thanks for help.urlpatternswithpath()