Я пытаюсь отобразить круговую диаграмму Matplotlib в HTML для Outlook. Это не работает. Может кто-то указать на ошибку и исправить. Выходной рис прилагается.
labels = 'Updated', 'Outdated'
explode = (0.0, 0.2) # only "explode" the slice (i.e. Updated', 'Outdated)
colors = ['Blue', 'Green', 'Red']
ServerPie= [dfServerUpdated.shape[0],dfServerOutdated.shape[0]]
fig1, ax1 = plt.subplots(figsize=(4,4))
ax1.pie(ServerPie, explode=explode, labels=labels,
shadow=True, startangle=680,counterclock=False,labeldistance= 1.2,autopct='%.2f',radius=1.5,rotatelabels = False) #autopct converts the values in terms of percentages and plots it in the pie chart.
ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
ax1.set_title("Servers Compliance ")
fname = BytesIO()
fname= 'image1.png'
plt.savefig(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None,
transparent=False, bbox_inches="tight", pad_inches=0,
frameon=True)
#fname.seek(0)
fig = plt.figure()
#plot sth
tmpfile = BytesIO()
fig.savefig(tmpfile, format='png')
encoded = base64.b64encode(tmpfile.getvalue())
#encoded = base64.b64encode(fname.getvalue())
#print(encoded)
html2 = '<html><head><body>' + '<img src=\'data:image/png;base64,{}\'>'.format(encoded) + '</body></html>'

Можно ли заставить работать круговую диаграмму в HTML?