Skip to content

Instantly share code, notes, and snippets.

@dipanjanS
Created January 10, 2018 21:36
Show Gist options
  • Save dipanjanS/4495440a810120fad45054fe9da5df32 to your computer and use it in GitHub Desktop.
Save dipanjanS/4495440a810120fad45054fe9da5df32 to your computer and use it in GitHub Desktop.
# Visualizing 4-D mix data using scatter plots
# leveraging the concepts of hue and facets for > 1 categorical attributes
g = sns.FacetGrid(wines, col="wine_type", hue='quality_label',
col_order=['red', 'white'], hue_order=['low', 'medium', 'high'],
aspect=1.2, size=3.5, palette=sns.light_palette('green', 4)[1:])
g.map(plt.scatter, "volatile acidity", "total sulfur dioxide", alpha=0.9,
edgecolor='white', linewidth=0.5, s=100)
fig = g.fig
fig.subplots_adjust(top=0.8, wspace=0.3)
fig.suptitle('Wine Type - Sulfur Dioxide - Acidity - Quality', fontsize=14)
l = g.add_legend(title='Wine Quality Class')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment