0

I have been using this code for my continues parameters to plot the probability distributions. However, my parameter now is price that cant be below zero, I have been reading to see if I can customize the density function so it dsnt go into negative numbers but havnt really found an answer. Does anyone know if there is a way to bound the density function?

fig = plt.figure(figsize=(6,4))
sns.distplot(data2018[ 'price'], hist=False)
sns.distplot(data2020[ 'price'], hist=False)
fig.legend(labels=['2018','2020'], bbox_to_anchor=(0.9,0.85))
baharak Al
  • 71
  • 1
  • 10
  • See [Limit the range of x in seaborn distplot KDE estimation](https://stackoverflow.com/questions/45911709/limit-the-range-of-x-in-seaborn-distplot-kde-estimation) – JohanC Dec 23 '20 at 19:11
  • Basically, there are negative values because that how a KDE works. [“Negative density” for non-negative variables](https://stats.stackexchange.com/questions/109549/negative-density-for-non-negative-variables) – JohanC Dec 23 '20 at 19:17

0 Answers0