How can I left align yaxis in horizontal bar

I use this sample to make horizontal bar chart but don’t know how to left align text in yaxis. Please help.

import plotly.graph_objects as go

fig = go.Figure(go.Bar(
x=[20, 14, 23],
y=[‘giraffes’, ‘orangutans’, ‘monkeys’],

Hi @hao.dn, you cannot configure ticks directly to do this (see Left align category labels on y-axis or Ticks: left-align first, right align last on x-axis). However, here is a workaround (courtesy of @alexcjohnson and @nicolaskruchten) which add a second axis, considered to be on the right (hence tick labels are left aligned), but positioned on the left. Hacky, but I hope it solves your problem :-).

import plotly.graph_objects as go
y = ['boa', 'giraffe', 'monkey', 'orangeoutans']
fig = go.Figure(go.Bar(
    x=[20, 14, 23, 4],
fig.update_layout(xaxis=dict(domain=[0.15, 0.9]),
                  yaxis2=dict(anchor='free', position=0.02,

thanks. It’s ok to me.