@@ -2749,7 +2749,10 @@ def voxels(self, filled, color=None):
27492749 Plot a set of filled voxels
27502750
27512751 All voxels are plotted as 1x1x1 cubes on the axis, with filled[0,0,0]
2752- placed with its lower corner at the origin. Occluded faces are not plotted
2752+ placed with its lower corner at the origin. Occluded faces are not
2753+ plotted.
2754+
2755+ .. versionadded:: 2.1
27532756
27542757 Parameters
27552758 ----------
@@ -2813,6 +2816,7 @@ def permutation_matrices(n):
28132816 yield mat
28142817 mat = np .roll (mat , 1 , axis = 0 )
28152818
2819+ # iterate over each of the YZ, ZX, and XY orientations
28162820 for permute in permutation_matrices (3 ):
28172821 # find the set of ranges to iterate over
28182822 pc , qc , rc = permute .T .dot (filled .shape [:3 ])
@@ -2822,8 +2826,13 @@ def permutation_matrices(n):
28222826
28232827 square_rot = square .dot (permute .T )
28242828
2829+ # iterate within the current plane
28252830 for p in pinds :
28262831 for q in qinds :
2832+ # iterate perpendicularly to the current plane, handling
2833+ # boundaries. We only draw faces between a voxel and an
2834+ # empty space, to avoid drawing internal faces.
2835+
28272836 # draw lower faces
28282837 p0 = permute .dot ([p , q , 0 ])
28292838 i0 = tuple (p0 )
0 commit comments