Skip to content

Instantly share code, notes, and snippets.

@NataliiaRastoropova
Last active February 19, 2020 14:34
Show Gist options
  • Save NataliiaRastoropova/244f311e2f0941a1dcb5a9c314bc63d5 to your computer and use it in GitHub Desktop.
Save NataliiaRastoropova/244f311e2f0941a1dcb5a9c314bc63d5 to your computer and use it in GitHub Desktop.
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