I am working on a Django project where I want to get data from CSV and build it on pages built using Django views / templates. Here is the code that I still have:
import matplotlib.pyplot as plt, mpld3
graph = plt.plot([1,2,3,4])
g = mpld3.fig_to_html(graph)
return HttpResponse(g)
However, when I run this, I get an error:
AttributeError: 'list' object has no attribute 'savefig'
Does anyone know where I did wrong, or how I can create graphics that I can add to pages that I already have, and not an MPLD3 page.
source
share