Bar width using Plotly express

Is there a way to set the width of each bar, or all bars using

The working examples I managed to found people were using graph.object. I just don’t want rewrite my code.

Hi @guilhermeely,

This is how you can do it

import as px
data_canada ="country == 'Canada'")
fig =, x='year', y='pop')

before updating figure:

after updating figure:

You should also have a look at the documentation, there are plenty of examples there:

hope this helps, Alex -

Thanks for the response.

Already tried that, the bars disappears if I do that.

1 Like

maybe you have set the width parameter too low, if you don’t provide any data I cannot help you further

Br, Alex

For the benefit of others landing on this page: when using the date type on the X axis the width units appear to be milliseconds.