Hi @lex1 welcome to the forums. You could separate the bars from each other and use annotations. I admit that it can get a bit cumbersome adjusting bargroupgap
and figure height as well as the y- position of the annotations.
import plotly.graph_objects as go
# data
categories = [
{"name": "Musée du Louvre, Paris", "value": 10200000},
{"name": "National Museum of China, Beijing", "value": 8610092},
{"name": "Metropolitan Museum of Art, New York City", "value": 6953927},
{"name": "Vatican Museums, Vatican City", "value": 6756186},
{"name": "Tate Modern, London", "value": 5868562},
{"name": "British Museum, London", "value": 5820000},
{"name": "National Gallery, London", "value": 5735831},
{"name": "National Gallery of Art, Washington D.C.", "value": 4404212},
{"name": "State Hermitage Museum, Saint Petersburg", "value": 4220000},
{"name": "Victoria and Albert Museum, London", "value": 3967566},
]
fig = go.Figure(
data=go.Bar(
x=[d.get('value') for d in categories],
text=["{:,.0f}".format(d.get("value")) for d in categories],
),
layout={
'bargroupgap':0.4,
'height': 600,
'yaxis':{'range':[-1, 10], 'visible': False},
}
)
for idx, name in enumerate([d.get('name') for d in categories]):
fig.add_annotation(
x=0,
y=idx + 0.45,
text=name,
xanchor='left',
showarrow=False,
yshift=0
)
fig.show()
creates: