我创建了一个无花果无花果,现在,我试图将此无花果写为excel文件作为图像。
如何使用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()
我也想将无花果添加到excel表中。