
Bikash Santra
Indian Statistical Institute, Kolkata
%matplotlib notebook
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
n = 100
xs = np.random.rand(n)
ys = np.random.rand(n)
zs = np.random.rand(n)
mask = zs < 0.5
c = ['r', 'b']
m = ['o', '^']
ax.scatter(xs[mask==0], ys[mask==0], zs[mask==0], c=c[0], marker=m[0])
ax.scatter(xs[mask==1], ys[mask==1], zs[mask==1], c=c[1], marker=m[1])
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.show()
a) Matpltlob documentation gallery
b) https://www.scipy-lectures.org/intro/matplotlib/index.html
c) https://www.scipy-lectures.org/packages/3d_plotting/index.html
d) https://github.com/kuleshov/cs228-material/blob/master/tutorials/python/cs228-python-tutorial.ipynb