Created
January 10, 2018 17:09
-
-
Save dipanjanS/c39aa1453db17be2ccf9058caf73e62d 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
# 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