seaborn from distplot to displot new input parameters

469 Views Asked by At

as Seaborn warned to prefer 'displot' to future deprecated 'distplot', I'm trying to change old codes. Unfortunately I find a bit hard finding corresponding parameters for several inputs. Just an example: below I start with the old 'distplot' code working:

c=np.random.normal(5,2,100)
sns.distplot(c,hist=True,kde=True,color='g',kde_kws={'color':'b','lw':2,'label':'Kde'},hist_kws={'color':'purple','alpha':0.8,
            'histtype':'bar','edgecolor':'k'})

Now, I want to show the same result with 'displot' but I don't know how to put 'alpha' for histogram as well as all the 'hist_kws' stuff. Below how I started:

sns.displot(data=c,kind='hist',kde=True,facecolor='purple',edgecolor='k',color='b',
            alpha=1,line_kws={'lw':2})

I'm looking for a better documentation but I didn't have luck so far

0

There are 0 best solutions below