%matplotlib inline from __future__ import print_function, division import matplotlib.pyplot as plt import numpy as np # This is the 3D plotting toolkit from mpl_toolkits import mplot3d fig = plt.figure() ax = plt.axes(projection='3d') z = np.linspace(0, 1, 100) x = z * np.sin(20 * z) y = z * np.cos(20 * z) c = x + y ax.scatter(x, y, z, c=c) fig = plt.figure() ax = plt.axes(projection='3d') ax.plot(x, y, z, '-b'); x = np.outer(np.linspace(-2, 2, 30), np.ones(30)) y = x.copy().T z = np.cos(x ** 2 + y ** 2) fig = plt.figure() ax = plt.axes(projection='3d') ax.plot_surface(x, y, z, cmap='cubehelix', rstride=1, cstride=1, linewidth=0); u = np.linspace(0, np.pi, 30) v = np.linspace(0, 2 * np.pi, 30) x = np.outer(np.sin(u), np.sin(v)) y = np.outer(np.sin(u), np.cos(v)) z = np.outer(np.cos(u), np.ones_like(v)) fig = plt.figure() ax = plt.axes(projection='3d') ax.plot_wireframe(x, y, z);