I need some help, and am at loss as to where to look. Using python with matplotlib, i generate some plots with matplotlib.pyplot.savefig to an BytesIO() object, and later change it to tempfile object just to see if it works. Should i use savefig to save them to a png file anywhere, it works. Should i take the data from BytesIO or tempfile and save it to a png it works. But i want to put them in an HTML doc, like so
print(plots)
for i, f in enumerate(plots):
f.seek(0)
html += """<div style="text-align: center">
<img style="max-width:100%" src=\"data:image/png;base64,{}\">
""".format(base64.b64encode(f.read()))
it genereates the file just fine, and base64 is clearly filled with data, but all my browsers see the images as broken. Point is this used to work in python 2.7, and now it doesn't, with no visible errors.