Looking for an easy way to plot cubes in 3D I found NumPy's mgrid that can do meshgrid in any number of dimensions. The syntax is a bit confusing but once you understand the trick, it works.
Here's a simple example that creates points for a unit cube and plots the points.
Here's a simple example that creates points for a unit cube and plots the points.
from pylab import *
from numpy import *
from mpl_toolkits.mplot3d import axes3d
# create 3D points
x,y,z = mgrid[0:2,0:2,0:2]
xx = x.flatten()
yy = y.flatten()
zz = z.flatten()
# plot 3D points
fig = figure()
ax = fig.gca(projection='3d')
ax.plot(xx,yy,zz,'o')
show()