Last active
February 19, 2020 14:34
-
-
Save NataliiaRastoropova/244f311e2f0941a1dcb5a9c314bc63d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fig, ax = plot.subplots() | |
fig = sns.distplot(df['CoffeeCupsPerDay'], hist=True, kde=True, | |
bins=8, color = 'c', | |
hist_kws={'edgecolor':'black'}, | |
kde_kws={'linewidth': 4}) | |
ax.set_xlabel('CoffeeCupsPerDay') | |
ax.set_ylabel('Frequency') | |
ax.set_title('Histogram of cups of coffee are drunk by programmers') | |
plot.axvline(df['CoffeeCupsPerDay'].mean(), color='k', linestyle='dashed', linewidth=1) | |
min_ylim, max_ylim = plot.ylim() | |
plot.text(df['CoffeeCupsPerDay'].mean()*1.1, max_ylim*0.9, 'Mean: {:.2f}'.format(df['CoffeeCupsPerDay'].mean())) | |
plot.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment