Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.