Bar chart shrink to a line when there is only one bar

Hello everyone!
I’ve got a bar chart with tick0 and range of week.
When there is only one bar it shrinks to a line like this:

(On 01/11)
Any ideas?

Hello @Karnishitrit,

Could you please provide an MRE of what you have?

It’s hard to say without seeing your data and code.

Hi @jinnyzor
My code is on another network so I can’t give a mre


Any thoughts on this?


Which bar chart are you using? PX or GO?


This usually happens, if the x-range is quite large, this would be my guess.

An example with 700 days on the x- axis- there is literally no space to draw the columns much wider.

import pandas as pd
import as px

# create data
week = pd.date_range('01/01/2022', periods=700, freq='D')
value = [0 for _ in range(700)]
value[155] = 60

# create DataFrame
df  = pd.DataFrame({'date': week, 'value': value})

# create figure
fig =, x='date', y='value')

which creates:


If you change the axis range to one week you get this:


1 Like

It’s go @jinnyzor

I have only 7 days on the x-axis (of the last week)
And one bar in it

Hi @Karnishitrit

Are you sure, that the x-axis are actually days? What does your data look like? What happens, if you create dummy values for the rest of the days, how does it look like then?

Did you try running my example on your system? Does it look like the images I attached here?

Without more information and the code which creates your figure it will be difficult to help you, I guess.