How can I put the shape in the categorical bar chart below in the middle of the bar specifying the number of giraffes in the SF Zoo (as shown in magenta)?
import plotly.graph_objects as go
import plotly.express as px
animals=['giraffes', 'orangutans', 'monkeys']
fig = go.Figure(data=[
go.Bar(name='SF Zoo', x=animals, y=[20, 14, 23]),
go.Bar(name='LA Zoo', x=animals, y=[12, 18, 29])
])
# Change the bar mode
fig.update_layout(barmode='group')
# Shape
fig.add_trace(go.Scatter(x=['giraffes', 'giraffes', 'orangutans', 'orangutans'],
y=[21, 25, 25, 16],
fill=None, mode="lines", line=dict(color='rgba(0,0,0,1)',width=2),
showlegend=False
)
)
fig.show()