import plotly
fig = {'data': [{'x': [1,2,3],
'y': [2,5,3],
'type': 'bar'}],
'layout': {'width': 800,
'height': 550}}
divplot = []
for i in range(5):
divplot.append(plotly.offline.plot(fig,
config={"displayModeBar": False},
show_link=False,
include_plotlyjs="cdn",
output_type='div'))
print(divplot)
html_string = '''
<html>
''' + divplot[0] + '''
''' + divplot[1] + '''
''' + divplot[2] + '''
''' + divplot[3] + '''
''' + divplot[4] + '''
</html>'''
with open("nick.html", 'w') as f:
f.write(html_string)