Skip to content

Instantly share code, notes, and snippets.

@homerjed
homerjed / ax_wireframe.py
Last active October 9, 2020 11:01
Plot a three-dimensional cubic wireframe
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection, Line3DCollection
def wireframe(ax):
Z = 1.05 * np.array([[-1,+1,-1], [+1,+1,-1],
[+1,-1,-1], [-1,-1,-1],
[-1,+1,+1], [+1,+1,+1],
[+1,-1,+1], [-1,-1,+1]])
verts = [[Z[0],Z[1],Z[2],Z[3]],