Guest User

Untitled

a guest
Jan 19th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. # Visualizing 3-D mix data using violin plots
  2. # leveraging the concepts of hue and axes for > 1 categorical dimensions
  3. f, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 4))
  4. f.suptitle('Wine Type - Quality - Acidity', fontsize=14)
  5.  
  6. sns.violinplot(x="quality", y="volatile acidity",
  7. data=wines, inner="quart", linewidth=1.3,ax=ax1)
  8. ax1.set_xlabel("Wine Quality",size = 12,alpha=0.8)
  9. ax1.set_ylabel("Wine Volatile Acidity",size = 12,alpha=0.8)
  10.  
  11. sns.violinplot(x="quality", y="volatile acidity", hue="wine_type",
  12. data=wines, split=True, inner="quart", linewidth=1.3,
  13. palette={"red": "#FF9999", "white": "white"}, ax=ax2)
  14. ax2.set_xlabel("Wine Quality",size = 12,alpha=0.8)
  15. ax2.set_ylabel("Wine Volatile Acidity",size = 12,alpha=0.8)
  16. l = plt.legend(loc='upper right', title='Wine Type')
Add Comment
Please, Sign In to add comment