1

I used sns.distplot, but it is a deprecated function. Is there any good alternative that have 'fit'?

sns.distplot(y, kde=False, fit=stats.norm)

Right now I'm using this

s1, loc2, scale2 = lognorm.fit(y)
r2 = lognorm.rvs(s1, loc2, scale2, size=r_size)
sns.histplot(data=r2, kde='True', ax=axes[1], alpha = 0)
sns.histplot(data=y, ax=axes[1])
axes[1].set_title('Log Normal')

enter image description here

Mr. T
  • 11,960
  • 10
  • 32
  • 54
Igor
  • 31
  • 5
  • 1
    You have to [emulate the old distplot](https://stackoverflow.com/a/67638591/8881141) but you came up with this solution yourself. – Mr. T Jan 09 '22 at 15:38
  • It was 1 string of code against 5 now. Maybe there is a better solution? – Igor Jan 09 '22 at 15:55
  • 1
    The creator of seaborn (@mwaskom) commented under the linked thread. If there was a simple substitute, he would have mentioned it, I assume. – Mr. T Jan 09 '22 at 15:57

0 Answers0