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

Skip to content

Commit 8bb0289

Browse files
committed
More pep8 fixes - deleted unused variables
1 parent 318397c commit 8bb0289

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

lib/matplotlib/collections.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,11 @@ def __init__(self, xranges, yrange, **kwargs):
778778
"""
779779
ymin, ywidth = yrange
780780
ymax = ymin + ywidth
781-
verts = [[(xmin, ymin), (xmin, ymax), (xmin + xwidth, ymax), (
782-
xmin + xwidth, ymin), (xmin, ymin)] for xmin, xwidth in xranges]
781+
verts = [[(xmin, ymin),
782+
(xmin, ymax),
783+
(xmin + xwidth, ymax),
784+
(xmin + xwidth, ymin),
785+
(xmin, ymin)] for xmin, xwidth in xranges]
783786
PolyCollection.__init__(self, verts, **kwargs)
784787

785788
@staticmethod
@@ -1370,12 +1373,12 @@ def convert_mesh_to_paths(meshWidth, meshHeight, coordinates):
13701373
c = coordinates
13711374

13721375
points = np.concatenate((
1373-
c[0:-1, 0:-1],
1374-
c[0:-1, 1:],
1375-
c[1:, 1:],
1376-
c[1:, 0:-1],
1377-
c[0:-1, 0:-1]
1378-
), axis=2)
1376+
c[0:-1, 0:-1],
1377+
c[0:-1, 1:],
1378+
c[1:, 1:],
1379+
c[1:, 0:-1],
1380+
c[0:-1, 0:-1]
1381+
), axis=2)
13791382
points = points.reshape((meshWidth * meshHeight, 5, 2))
13801383
return [Path(x) for x in points]
13811384

@@ -1385,40 +1388,38 @@ def convert_mesh_to_triangles(self, meshWidth, meshHeight, coordinates):
13851388
with its own color. This is useful for experiments using
13861389
`draw_qouraud_triangle`.
13871390
"""
1388-
Path = mpath.Path
1389-
13901391
if ma.isMaskedArray(coordinates):
13911392
p = coordinates.data
13921393
else:
13931394
p = coordinates
13941395

1395-
p_a = p[0:-1, 0:-1]
1396-
p_b = p[0:-1, 1:]
1396+
p_a = p[:-1, :-1]
1397+
p_b = p[:-1, 1:]
13971398
p_c = p[1:, 1:]
1398-
p_d = p[1:, 0:-1]
1399+
p_d = p[1:, :-1]
13991400
p_center = (p_a + p_b + p_c + p_d) / 4.0
14001401

14011402
triangles = np.concatenate((
1402-
p_a, p_b, p_center,
1403-
p_b, p_c, p_center,
1404-
p_c, p_d, p_center,
1405-
p_d, p_a, p_center,
1406-
), axis=2)
1403+
p_a, p_b, p_center,
1404+
p_b, p_c, p_center,
1405+
p_c, p_d, p_center,
1406+
p_d, p_a, p_center,
1407+
), axis=2)
14071408
triangles = triangles.reshape((meshWidth * meshHeight * 4, 3, 2))
14081409

14091410
c = self.get_facecolor().reshape((meshHeight + 1, meshWidth + 1, 4))
1410-
c_a = c[0:-1, 0:-1]
1411-
c_b = c[0:-1, 1:]
1411+
c_a = c[:-1, :-1]
1412+
c_b = c[:-1, 1:]
14121413
c_c = c[1:, 1:]
1413-
c_d = c[1:, 0:-1]
1414+
c_d = c[1:, :-1]
14141415
c_center = (c_a + c_b + c_c + c_d) / 4.0
14151416

14161417
colors = np.concatenate((
1417-
c_a, c_b, c_center,
1418-
c_b, c_c, c_center,
1419-
c_c, c_d, c_center,
1420-
c_d, c_a, c_center,
1421-
), axis=2)
1418+
c_a, c_b, c_center,
1419+
c_b, c_c, c_center,
1420+
c_c, c_d, c_center,
1421+
c_d, c_a, c_center,
1422+
), axis=2)
14221423
colors = colors.reshape((meshWidth * meshHeight * 4, 3, 4))
14231424

14241425
return triangles, colors

0 commit comments

Comments
 (0)