Skip to content

Instantly share code, notes, and snippets.

@dipanjanS
Created January 10, 2018 20:00
Show Gist options
  • Save dipanjanS/3be5202525510e6c4a58b90ede0ca68d to your computer and use it in GitHub Desktop.
Save dipanjanS/3be5202525510e6c4a58b90ede0ca68d to your computer and use it in GitHub Desktop.
# Visualizing 3-D mix data using box plots
# leveraging the concepts of hue and axes for > 1 categorical dimensions
f, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 4))
f.suptitle('Wine Type - Quality - Alcohol Content', fontsize=14)
sns.boxplot(x="quality", y="alcohol", hue="wine_type",
data=wines, palette={"red": "#FF9999", "white": "white"}, ax=ax1)
ax1.set_xlabel("Wine Quality",size = 12,alpha=0.8)
ax1.set_ylabel("Wine Alcohol %",size = 12,alpha=0.8)
sns.boxplot(x="quality_label", y="alcohol", hue="wine_type",
data=wines, palette={"red": "#FF9999", "white": "white"}, ax=ax2)
ax2.set_xlabel("Wine Quality Class",size = 12,alpha=0.8)
ax2.set_ylabel("Wine Alcohol %",size = 12,alpha=0.8)
l = plt.legend(loc='best', title='Wine Type')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment