Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4d8c08

Browse files
authored
Merge pull request #12826 from timhoffm/minor-cleanup
Minor code cleanup
2 parents d4b42b6 + c5bbac2 commit d4d8c08

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,14 +1732,14 @@ def get_normals(polygons):
17321732
return polyc
17331733

17341734
def _generate_normals(self, polygons):
1735-
'''
1735+
"""
17361736
Generate normals for polygons by using the first three points.
17371737
This normal of course might not make sense for polygons with
17381738
more than three points not lying in a plane.
17391739
17401740
Normals point towards the viewer for a face with its vertices in
17411741
counterclockwise order, following the right hand rule.
1742-
'''
1742+
"""
17431743

17441744
normals = []
17451745
for verts in polygons:
@@ -1749,10 +1749,10 @@ def _generate_normals(self, polygons):
17491749
return normals
17501750

17511751
def _shade_colors(self, color, normals, lightsource=None):
1752-
'''
1752+
"""
17531753
Shade *color* using normal vectors given by *normals*.
17541754
*color* can also be an array of the same length as *normals*.
1755-
'''
1755+
"""
17561756
if lightsource is None:
17571757
# chosen for backwards-compatibility
17581758
lightsource = LightSource(azdeg=225, altdeg=19.4712)
@@ -1762,7 +1762,7 @@ def _shade_colors(self, color, normals, lightsource=None):
17621762
for n in normals])
17631763
mask = ~np.isnan(shade)
17641764

1765-
if len(shade[mask]) > 0:
1765+
if mask.any():
17661766
norm = Normalize(min(shade[mask]), max(shade[mask]))
17671767
shade[~mask] = min(shade[mask])
17681768
color = mcolors.to_rgba_array(color)

0 commit comments

Comments
 (0)