Not a serious issue, just a report with some behavior that was unexpected for me:
When a NaN value is passed for x or y to add_annotation
, the annotation seems to appear in the middle of the plot.
This is in contrast to add_scatter
which gracefully handles NaNs by ignoring them.
This is of course trivial to work around, but the difference makes me think the former is just a bug. It gives a pretty misleading result if you happen not to catch the NaN.
fig=go.Figure()
x=[0,1,2,np.nan,3]
y=[4,5,6,np.nan,7]
a=list('abcde')
fig.add_scatter(x=x,y=y,text=a,mode='markers')
for xi,yi,ai in zip(x,y,a):
fig.add_annotation(x=xi,y=yi,text=ai)
fig