histplot is showing data grouped in pairs

39 Views Asked by At

I'm trying to create a histoplot to show a certain column of my dataframe that I'm sure has values for every single integer going from 47 to 93 but when I plot it it leaves spaces every two values. I'm not sure if this is intended behavior and in case it is how I'd go about changing it?

sns.histplot(data['overall']) enter image description here

1

There are 1 best solutions below

1
On

You can try setting bins to all the unique values:

data = pd.DataFrame({'overall' : [item for sublist in [[x]*x for x in range(1, 11)] for item in sublist]})
sns.histplot(data['overall'], bins=data['overall'].unique())

enter image description here