Pythonで学ぶPlotlyによるデータ可視化入門
Alex Scriven
Data Scientist
$$

$$
add_annotation() の利用$$
update_layout() の annotations 引数を利用text - 表示するテキスト$$
x と y - 注釈の位置$$
showarrow = True/False - 矢印の有無$$
🛑 絶対配置は注意。データが変わると重なることがあります
x と y はプロット内のデータ値$$
xref と yref を paper にすると注釈を絶対配置x と y はプロット領域で 0〜1 の割合x=0.5, y=0.5) は中央
my_annotation = dict( x=215111, y=449000,showarrow=True, arrowhead=3,text="Our company is doing well", font=dict(size=10, color="black") )fig.update_layout(annotations=[my_annotation]) fig.show()
$$

$$
float_annotation = dict( xref="paper", yref="paper",x=0.5, y=0.8,showarrow=False, text="You should <b>BUY</b>", font=dict(size=15, color="black"), bgcolor="rgb(255,0,0)" )

Pythonで学ぶPlotlyによるデータ可視化入門