getting mean and standard deviation from best-fit normal distribution using seaborn library

Viewed 2853

I have a set of data and I used seaborn library to plot the histogram, apply kernel density estimate and fit a normal distribution to the data. However I would like to extract the mean and standard deviation of the best-fit normal distribution. How could I get these values as outputs from the function distplot of this library? My code:

import seaborn as sns
from scipy.stats import norm 
sns.set_style("darkgrid")
sns.set_context("paper", font_scale=1, rc={"lines.linewidth": 1.5, "axes.linewidth": 1.0, "axes.labelsize": 15, "xtick.labelsize": 10, "ytick.labelsize": 10, "font.family":'serif','font.serif':'Ubuntu'})

fig, axes = plt.subplots(1, 1, figsize=(10, 10))
sns.distplot(C,
            fit=norm, kde=True,
            fit_kws ={"color": "#fc4f30", "lw": 1.5},
            kde_kws={"color": "y", "lw": 1.5},
            hist_kws={"histtype": "stepfilled", "linewidth": 1, "alpha": 0.1, "color": "b"},
            norm_hist=True, ax=axes[0,0])

A bug in seaborn library is that, it doesn't generate the label for the fitted normal distribution but it does for histogram or kernel density.
enter image description here

How can I get the normal distribution parameters and make a label for it in the plot?

1 Answers
Related