Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Visualizing 6-D mix data using scatter charts
- # leveraging the concepts of hue, size, depth and shape
- fig = plt.figure(figsize=(8, 6))
- t = fig.suptitle('Wine Residual Sugar - Alcohol Content - Acidity - Total Sulfur Dioxide - Type - Quality', fontsize=14)
- ax = fig.add_subplot(111, projection='3d')
- xs = list(wines['residual sugar'])
- ys = list(wines['alcohol'])
- zs = list(wines['fixed acidity'])
- data_points = [(x, y, z) for x, y, z in zip(xs, ys, zs)]
- ss = list(wines['total sulfur dioxide'])
- colors = ['red' if wt == 'red' else 'yellow' for wt in list(wines['wine_type'])]
- markers = [',' if q == 'high' else 'x' if q == 'medium' else 'o' for q in list(wines['quality_label'])]
- for data, color, size, mark in zip(data_points, colors, ss, markers):
- x, y, z = data
- ax.scatter(x, y, z, alpha=0.4, c=color, edgecolors='none', s=size, marker=mark)
- ax.set_xlabel('Residual Sugar')
- ax.set_ylabel('Alcohol')
- ax.set_zlabel('Fixed Acidity')
Add Comment
Please, Sign In to add comment