-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Here, I am trying to plot a bar chart and in the case there is a really long label, the plotly figure resizes itself an changes the angle of the labels.
What I want is this:

I can get this by adding a <br> in the label, however, I am unable to generate this despite adjusting the parameters like ticklen, tickwidth and setting automargin. The plot I am getting looks like this.

There are more solutions regarding adjustment of margin, however I am still unable to get the label in two lines. Is there any documentation that could point me towards the solution?
I have attached the snippet here.
x1 = ['A very long sentence that needs broken up fhasfb asfasfz cas wfwfer wrwnflf fwerf', 'Regular Length', "Cory", "Dave"]
y1 = [20, 30, 25, 40]
fig = go.Figure()
fig.add_trace(go.Bar(x=x1, y=y1))
fig.update_layout(
xaxis={
'ticklen' : 4,
'automargin': True,
'tickwidth' : 1.2}
)Metadata
Metadata
Assignees
Labels
No labels