Bargap not working when add width
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:
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
Are there other ways to use barsgap and width simultaneously?
Thank you.