I am trying to obtain the pdf of a histogram using seaborn library, but the pdf returned has non zero probabilites for zero valued bins.
For example:
array = np.arange(20)
reversed_arr = array[::-1]
fig, axs = plt.subplots(1, 1, figsize=(30, 10))
ax1 = sns.distplot(reversed_arr, ax=axs, label='my hist')
fit1 = ax1.get_lines()[0].get_data()
xfit1, yfit1 = fit1[0], fit1[1]
ax1.legend()
axs.plot(xfit1, yfit1, label='my pdf')
axs.set_ylim(ax1.get_ylim())
plt.legend()
plt.show()
As you can see, before zero (and after 18) on the x-axis, there are no values, yet positive probabilities.
Any help?