Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Visualizing 3-D mix data using violin 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 - Acidity', fontsize=14)
- sns.violinplot(x="quality", y="volatile acidity",
- data=wines, inner="quart", linewidth=1.3,ax=ax1)
- ax1.set_xlabel("Wine Quality",size = 12,alpha=0.8)
- ax1.set_ylabel("Wine Volatile Acidity",size = 12,alpha=0.8)
- sns.violinplot(x="quality", y="volatile acidity", hue="wine_type",
- data=wines, split=True, inner="quart", linewidth=1.3,
- palette={"red": "#FF9999", "white": "white"}, ax=ax2)
- ax2.set_xlabel("Wine Quality",size = 12,alpha=0.8)
- ax2.set_ylabel("Wine Volatile Acidity",size = 12,alpha=0.8)
- l = plt.legend(loc='upper right', title='Wine Type')
Add Comment
Please, Sign In to add comment