Individually labeled bars for bar graph in Plotly
I was trying to create annotations for grouped bar charts - where each bar has a specific data label that shows the value of that bar and is located above the centre of the bar. I tried a simple modification of the examples in tutorial to achieve this, as follows: import plotly.plotly as py import plotly.graph_objs as go x = ['Product A', 'Product B', 'Product C'] y1 = [20, 14, 23] y2 = [12, 18, 29] annotations1 = [dict( x=xi, y=yi, text=str(yi), xanchor='auto', yanchor='bottom', showarrow=False, ) for xi, yi in zip(x, y1)] annotations2 = [dict( x=xi, y=yi, text=str(yi), xanchor='auto',