I have an existing system using matplotlib that just saves the figure to a .png file:
rootfilename = '%d.png' % t
fyle = settings.MEDIA_ROOT + '/' + rootfilename
fig.savefig(fyle)
context = {'ourimg' : rootfilename}
return render(request, 'sensors/img.html', context)
That works to show the graph I am expecting:
But I tried using mpld3:
g = mpld3.fig_to_html(fig)
return HttpResponse(g)
... and it's not even close. I get the y ticks correct (but smaller) but none of the graphs I see on the same figure saved to a file and displayed the other way.
I must be missing something; help please!