Skip to content

Instantly share code, notes, and snippets.

@dipanjanS
Created January 10, 2018 17:09
Show Gist options
  • Save dipanjanS/c39aa1453db17be2ccf9058caf73e62d to your computer and use it in GitHub Desktop.
Save dipanjanS/c39aa1453db17be2ccf9058caf73e62d to your computer and use it in GitHub Desktop.
# Histogram
fig = plt.figure(figsize = (6,4))
title = fig.suptitle("Sulphates Content in Wine", fontsize=14)
fig.subplots_adjust(top=0.85, wspace=0.3)
ax = fig.add_subplot(1,1, 1)
ax.set_xlabel("Sulphates")
ax.set_ylabel("Frequency")
ax.text(1.2, 800, r'$\mu$='+str(round(wines['sulphates'].mean(),2)),
fontsize=12)
freq, bins, patches = ax.hist(wines['sulphates'], color='steelblue', bins=15,
edgecolor='black', linewidth=1)
# Density Plot
fig = plt.figure(figsize = (6, 4))
title = fig.suptitle("Sulphates Content in Wine", fontsize=14)
fig.subplots_adjust(top=0.85, wspace=0.3)
ax1 = fig.add_subplot(1,1, 1)
ax1.set_xlabel("Sulphates")
ax1.set_ylabel("Frequency")
sns.kdeplot(wines['sulphates'], ax=ax1, shade=True, color='steelblue')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment