Skip to content

Instantly share code, notes, and snippets.

@dipanjanS
Created January 10, 2018 21:15
Show Gist options
  • Save dipanjanS/c765c998d543afc6664fe1214f360191 to your computer and use it in GitHub Desktop.
Save dipanjanS/c765c998d543afc6664fe1214f360191 to your computer and use it in GitHub Desktop.
# Visualizing 4-D mix data using bubble plots
# leveraging the concepts of hue and size
size = wines['residual sugar']*25
fill_colors = ['#FF9999' if wt=='red' else '#FFE888' for wt in list(wines['wine_type'])]
edge_colors = ['red' if wt=='red' else 'orange' for wt in list(wines['wine_type'])]
plt.scatter(wines['fixed acidity'], wines['alcohol'], s=size,
alpha=0.4, color=fill_colors, edgecolors=edge_colors)
plt.xlabel('Fixed Acidity')
plt.ylabel('Alcohol')
plt.title('Wine Alcohol Content - Fixed Acidity - Residual Sugar - Type',y=1.05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment