plotly_express icon indicating copy to clipboard operation
plotly_express copied to clipboard

Bargap not working when add width

Open RyMey opened this issue 6 years ago • 0 comments

Hi, I try to make a mosaic plot with bar in plotly express. Because mosaic have different width and height proportion depends on the frequency of data, so I update the weight of the bar and change bargap. I used the code below figure = px.bar(data_new, x='Mode',y='freq', color = "GENDER",orientation='v') figure.layout = {'bargap':0.025, 'barmode':'relative'} figure.update_traces(width = [0.05, 0.25, 0.15, 0.1, 0.2, 0.4, 0.2,0.1]) and produce plot like this: Screen Shot 2019-07-17 at 10 24 51 My code is doesn't change any gap of my bar, but when I delete the width like this code figure = px.bar(data_new, x='Mode',y='freq', color = "GENDER",orientation='v') figure.layout = {'bargap':0.025, 'barmode':'relative'} the bargap is work like this picture Screen Shot 2019-07-17 at 10 28 28 Are there other ways to use barsgap and width simultaneously? Thank you.

RyMey avatar Jul 17 '19 03:07 RyMey