Multilevel Axes Labels with plotly : how to turn the label

Hello,

I have not found a solution to turn the X label

code :

item = ā€˜RS0753ā€™

df = df_group_by_feeder_slot[df_group_by_feeder_slot[ā€˜Name_Itemsā€™] == ā€˜RS0753ā€™]

fig = go.Figure()
for feeder in df[ā€˜Identifier_MaterialCarriersā€™].unique():
for slot in df[(df[ā€˜Identifier_MaterialCarriersā€™] == feeder)][ā€˜Slot_MaterialCarriersā€™].unique():
fig.add_trace(go.Bar(
x = [df[(df[ā€˜Identifier_MaterialCarriersā€™] == feeder) & (df[ā€˜Slot_MaterialCarriersā€™] == slot)][ā€˜Identifier_MaterialCarriersā€™], df[(df[ā€˜Identifier_MaterialCarriersā€™] == feeder) & (df[ā€˜Slot_MaterialCarriersā€™] == slot)][ā€˜Slot_MaterialCarriersā€™]],
y = df[(df[ā€˜Identifier_MaterialCarriersā€™] == feeder) & (df[ā€˜Slot_MaterialCarriersā€™] == slot)][ā€˜ratio_sum_total_errorā€™],
name = feeder + ā€™ ā€™ + slot,))
fig.update_layout(title_text=ā€œMulti-category axisā€)

fig.update_layout(
title=ā€˜ratio by feeder and slotā€™ + ā€™ ā€™ + 'item ā€™ + item,
xaxis_title=ā€œfeeder _ slotā€,
xaxis_dtick= 1,
xaxis_tickangle=90,
yaxis_title=ā€œratio_sum_total_errorā€,
yaxis_dtick= 0.1,
font=dict(size=10,))
fig.update_layout(
autosize=False,
width=1000,
height=500)
fig.update(layout_showlegend=False)
fig.update_layout(bargap= 0.2)

fig.show()

Hi @Marc_L ,

Welcome to the forum!

have you tried setting autotickangles ?
Suppose you want to turn the tick 45 degree clockwise.

fig.update_xaxes(autotickangles=[-45])

docs :

hello,

I tried to use it in dash app.
that return a error see picture.

Hi @Marc_L ,

I think you need to upgrade the version at least version 5.19 to use this attribute .

Hope this help.

Hello,

I have tried with :slight_smile:
plotly 5.24.1
Same result.

I will dig on it, could be dash version.

Thanks again