I have a matplotlib figure that is converted to a png :
figure_new.savefig('figure_new.png', bbox_inches='tight', pad_inches=0
and a styler objectreport_new
that is rendered as a html table :
report_html=fo.write(plunge_results[_j].report_new.render())
i use following code to put styler as a HTML table and png image in a HTML file:
data_uri = base64.b64encode(open('figure_new.png', 'rb').read()).decode('utf-8').replace('\n', '')
img_tag = '<img src="data:image/png;base64,{0}">'.format(data_uri)
with open('report_new.html','w') as fo :
report_html=fo.write(plunge_results[_j].report_new.render())
report_html=fo.write(img_tag)
result contains a html table and one image below it , what i need is :
put png image side by side of the html table in the same length or inserting image as a column of the HTML table something like this :