Hello.
We are often creating barplots with very long labels, in particular we use horizontal barplots to fit them. They should resize dynamically, e.g. for displaying them in Dash
When the label is too long, it gets cut off, which makes sense: but, i think the default behaviour is a bit rough, it almost looks like a bug.
The below example shows the problem, where a small width change creates a very worse outcome, while there are at least two ways to make it look better: (1) shrink the plot area even further, (2) cut off a smaller fraction of the label.
I did try the Automargin keyword, but i donβt think itβs what iβm looking for.
My questions are:
- is this behaviour controllable in any way? Even a workaround would work for us (it should work dynamically though).
- Would it be useful if i opened a Github Issue about this problem?
Self contained code:
import plotly.graph_objects as go
yy = ["this::::::: ____ will be cut away::OOOOOOOOOOO______:Apples",
"this::::::: ____ will be cut away::OOOOOOOOOOO______:Oranges",
"this::::::: ____ will be cut away::OOOOOOOOOOO______:Bananas",
"this::::::: ____ will be cut away::OOOOOOOOOOO______:Pears",]
xx = [4, 1, 2, 5]
go.Figure([go.Bar(orientation='h', x=xx, y=yy)],
go.Layout(width=900))
go.Figure([go.Bar(orientation='h', x=xx, y=yy)],
go.Layout(width=800))
Thanks!