I created a plotly fig and now, I'm trying to write this fig to excel file as an image.
How can I do this using Python?
data = []
data.append(
go.Bar(
x=df['id'],
y=df['normalize energy'],
hoverlabel = dict(namelength = -1)
)
)
layout = dict(
title="energy" ,
xaxis=dict(
title='id'
),
yaxis=dict(
title='energy [W]',
titlefont=dict(
color='rgb(148, 103, 189)'
),
tickfont=dict(
color='rgb(148, 103, 189)'
),
overlaying='y',
side='right',
fixedrange=False
),
height= 600
)
fig = go.FigureWidget(data)
fig.layout = layout
fig
writer = pd.ExcelWriter(path)
df.to_excel(writer,'Sheet1')
writer.save()
I want to add the fig to the excel sheet as well.