Hi everyone,
I am using the following code to subplot based on “level”, where level is category (‘Family’ and ‘Genus’). While I get the two subplots, both annotations appear on the first facet i.e. ‘Family’. How can I fix this so that the first annotation appears on the ‘Family’ facet and the second on the ‘Genus’. In other words is there a way to ask plotly to annotate particular data points on their specified facets?
fig = px.scatter(df2, x=‘clr’, y=‘W’, size=‘W’, color= ‘W’, color_continuous_scale=‘bluered’, facet_col=“level”)
fig.add_annotation(x=3, y=49,
text=“Rods”,
showarrow=True,
arrowhead=3)
fig.add_annotation(x=5, y=32,
text=“Cocci”,
showarrow=True,
arrowhead=3)
fig.update_layout(
autosize=False,
width=800,
height=500)
fig.for_each_annotation(lambda a: a.update(text=a.text.replace(“level=”, “”)))
fig.show()