✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Y title "bug". Y tilte moved so far to left

It is a topic from comment

So I did not get an answer, and I hope to get an answer from a new topic.

Result:

My code

fig = go.Figure(data=[go.Bar(x = ICP['Name'], y = ICP['au'],
                                text=round(ICP['au'], 3),
                                textposition='auto')])
fig.update_yaxes(type="log", showgrid=True, dtick=1)
#your method
tickvals = np.concatenate((np.arange(0.004, 0.01, 0.001),
                           np.arange(0.01, 0.1, 0.01),
                           np.arange(0.1, 1.1, 0.1),
                           np.arange(1, 10.1, 1)))
ticktext = [str(val) if val in [0.01, 0.1, 1, 10] else '' for val in tickvals]
fig.update_yaxes(type="log", tickvals=tickvals, ticktext=ticktext, showgrid=True)


fig.update_layout(
    template="simple_white",
    #title="Us influence on CO conversion",
    xaxis_title= "Type",
    yaxis_title="log, [%]",
    font=dict(
        size=14,
        color="black")
)

fig.show()

Can somebody answer, why Y title moved to left so far and how to correct it?

Hi.

I had the same issue after trying to do the same thing. I think I figured out how to manually fix it and I’ll leave this solution here in case someone also has the same issue in the future.

I used “title_standoff = n”; n is the number of pixels you want to offset.

Hope that helps

Never mind…that was a band-aid solution.

The good news is that I’m pretty sure I found the cause of the problem and how to fix it…

You need to disable automargin. I used “automargin=False” and it fixed the problem.