Skip to content

Commit 7680655

Browse files
committed
pep8
1 parent a0ee437 commit 7680655

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
@@ -224,8 +224,8 @@ def _to_rgba_no_colorcycle(c, alpha=None):
224224
match = re.match(r"\A#[a-fA-F0-9]{6}\Z", c)
225225
if match:
226226
return (tuple(int(n, 16) / 255
227-
for n in [c[1:3], c[3:5], c[5:7]])
228-
+ (alpha if alpha is not None else 1.,))
227+
for n in [c[1:3], c[3:5], c[5:7]]) +
228+
(alpha if alpha is not None else 1.,))
229229
# hex color with alpha.
230230
match = re.match(r"\A#[a-fA-F0-9]{8}\Z", c)
231231
if match:
@@ -836,7 +836,8 @@ def __getitem__(self, item):
836836
if not isinstance(sss[2], complex):
837837
sss[2] = sss[2] / self.N
838838
if sss[0] < 0 or sss[0] >= 1 or sss[1] <= 0 or sss[1] > 1:
839-
raise IndexError("Invalid colorbar itemization - outside bounds")
839+
raise IndexError("Invalid colorbar itemization - outside "
840+
"bounds")
840841
points = np.mgrid[slice(*sss)]
841842
elif isinstance(item, (list, np.ndarray)):
842843
name = self.name + '[<indexed>]'
@@ -846,12 +847,14 @@ def __getitem__(self, item):
846847
item = item.astype('f') / self.N
847848
item[item < 0] += 1
848849
if np.any(item > 1):
849-
raise IndexError("Invalid colorbar itemization - outside bounds")
850+
raise IndexError("Invalid colorbar itemization - outside "
851+
"bounds")
850852
points = item
851853
else:
852854
raise IndexError("Invalid colorbar itemization")
853855
if len(points) <= 1:
854-
raise IndexError("Invalid colorbar itemization - a colorbar must contain >1 color.")
856+
raise IndexError("Invalid colorbar itemization - a colorbar must "
857+
"contain >1 color.")
855858
return ListedColormap(self(points), name=name)
856859

857860

0 commit comments

Comments
 (0)