STYLE: Use np.array instead of np.r_ and import Poly3DCollection

This commit is contained in:
Josh Warner (Mac)
2013-09-02 15:31:51 -05:00
parent 1174d6fbc5
commit abc7a16a80
2 changed files with 56 additions and 56 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ voxel spacing is not equal for every spatial dimension, through use of the
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import mpl_toolkits.mplot3d as a3
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from skimage import measure
from skimage.draw import ellipsoid
@@ -41,8 +41,8 @@ verts, faces = measure.marching_cubes(ellip_double, 0)
fig = plt.figure(figsize=(10, 12))
ax = fig.add_subplot(111, projection='3d')
# Fancy indexing: `verts[faces]` to generate a Poly3DCollection
mesh = a3.art3d.Poly3DCollection(verts[faces])
# Fancy indexing: `verts[faces]` to generate a collection of triangles
mesh = Poly3DCollection(verts[faces])
ax.add_collection3d(mesh)
ax.set_xlabel("x-axis: a = 6 per ellipsoid")