Skip to content

Commit 6f0a342

Browse files
committed
pep8
1 parent c2bd712 commit 6f0a342

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/matplotlib/colors.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ def _to_rgba_no_colorcycle(c, alpha=None):
241241
match = re.match(r"\A#[a-fA-F0-9]{6}\Z", c)
242242
if match:
243243
return (tuple(int(n, 16) / 255
244-
for n in [c[1:3], c[3:5], c[5:7]])
245-
+ (alpha if alpha is not None else 1.,))
244+
for n in [c[1:3], c[3:5], c[5:7]]) +
245+
(alpha if alpha is not None else 1.,))
246246
# hex color with alpha.
247247
match = re.match(r"\A#[a-fA-F0-9]{8}\Z", c)
248248
if match:
@@ -851,7 +851,8 @@ def __getitem__(self, item):
851851
if not isinstance(sss[2], complex):
852852
sss[2] = sss[2] / self.N
853853
if sss[0] < 0 or sss[0] >= 1 or sss[1] <= 0 or sss[1] > 1:
854-
raise IndexError("Invalid colorbar itemization - outside bounds")
854+
raise IndexError("Invalid colorbar itemization - outside "
855+
"bounds")
855856
points = np.mgrid[slice(*sss)]
856857
elif isinstance(item, (list, np.ndarray)):
857858
name = self.name + '[<indexed>]'
@@ -861,12 +862,14 @@ def __getitem__(self, item):
861862
item = item.astype('f') / self.N
862863
item[item < 0] += 1
863864
if np.any(item > 1):
864-
raise IndexError("Invalid colorbar itemization - outside bounds")
865+
raise IndexError("Invalid colorbar itemization - outside "
866+
"bounds")
865867
points = item
866868
else:
867869
raise IndexError("Invalid colorbar itemization")
868870
if len(points) <= 1:
869-
raise IndexError("Invalid colorbar itemization - a colorbar must contain >1 color.")
871+
raise IndexError("Invalid colorbar itemization - a colorbar must "
872+
"contain >1 color.")
870873
return ListedColormap(self(points), name=name)
871874

872875

0 commit comments

Comments
 (0)