Tut
February 13, 2022, 11:04am
1
2 hours that I try to change yaxis in order to display labels, Nothing works …
layout = go.Layout(margin = {"l":400})
data = px.bar(data_frame=count_metier, y=count_metier.index, x="count_metier", orientation = "h")
fig = go.Figure(data=data, layout=layout)
fig.show()
How could I do it ? I am loosing my nerves …
empet
February 14, 2022, 7:51pm
2
@Tut
Calmez s’il vous plaît! It appears that you are running an old Plotly version. With the last one, 5.6.0
(pip install plotly --upgrade
),
and this code:
import plotly.graph_objects as go
fig = go.Figure(go.Bar( x=[20,19,25,9], y=["Chocolatier choco au lait","Sylviculteur",
"Socioculturelle","Critique gastronomique"], orientation= "h"))
fig.update_layout(xaxis_title="count métier", yaxis_title="métier", height=400)
fig.show()
i.e. no width
or margin
settings, I got this nice plot: