Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Redraw/reload plot with Jupyter Notebook

Hi,
I’m creating a time series plot with py.iplot(fig, filename = ‘someName’) using a Jupyter notebook and added a widgets.Button which calls a function changing the text of an annotation on the plot:
on_button_clicked(b):
annotations = list([
dict(x=5, y=30, xref=‘x’,yref=‘y’,text=‘new text’,showarrow=False)
])
layout[‘annotations’] = annotations
fig = dict(data=data, layout=layout)
How do I reload/redraw the plot with the new annotation? Calling py.iplot again has no effect.
Any help is much appreciated, thanks, Ann.