Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Bargap not working when add width #118

Open
RyMey opened this issue Jul 17, 2019 · 0 comments
Open

Bargap not working when add width #118

RyMey opened this issue Jul 17, 2019 · 0 comments

Comments

@RyMey
Copy link

RyMey commented Jul 17, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant