How to annotate a point outside the plot itself?
问题 I have a plot like this and want to add text above the line with text 'TODAY'. I was trying with annotations annots.append(dict(x='2020-03-29',y=len(df)+1,text='<b>Today<b>', showarrow=False, font=dict(color='black'))) But the output is as such and I want it above the plot and not changing the structure of the plot! 回答1: You can do so in three steps: adjust margins to make room for the text using fig.update_layout(margin=dict()) add line using fig.add_shape() add text outside plot using add