3D Scatter Plot in Python

Visualizing 3-D numeric data with Scatter Plots

length, breadth and depth

Ref: https://towardsdatascience.com/the-art-of-effective-visualization-of-multi-dimensional-data-6c7202990c57

import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
import numpy as np
import seaborn as sns
%matplotlib inline

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection=’3d’)

xs = wines[‘residual sugar’]
ys = wines[‘fixed acidity’]
zs = wines[‘alcohol’]
ax.scatter(xs, ys, zs, s=50, alpha=0.6, edgecolors=’w’)

ax.set_xlabel(‘Residual Sugar’)
ax.set_ylabel(‘Fixed Acidity’)
ax.set_zlabel(‘Alcohol’)

Other Visualizations of Wine Data

Univariate Analysis

tight_layout, 15 bins

Correlation Maps: Multivariate Analysis

Seaborn – Heatmaps

plot parallel coordinates

BOX Plot

Violin plot: sns.violinplot(x=”quality”, y=”sulphates”, data=wines, ax=ax) : Seaborn

3d Pairwise Scatter Plot

Images are taken from my own executions.

Leave a Reply