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?
Asked
Active
Viewed 33 times
0
-
You can set `discrete=True` in the call to `sns.histplot(....)`. – JohanC Apr 29 '23 at 16:20
1 Answers
0
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())

René
- 4,594
- 5
- 23
- 52
-
2You don't need to pass both `bins` and `discrete`; `discrete` is a manner of setting the bins. – mwaskom Apr 29 '23 at 13:45