Skip to content

Commit 819c2d8

Browse files
committed
Merge pull request matplotlib#1396 from NelleV/pep8_colors
PEP8 fixes on colors
2 parents 5bcd2d2 + 78bde28 commit 819c2d8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/matplotlib/colors.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def to_rgb(self, arg):
307307
raise ValueError(
308308
'sequence length is %d; must be 3 or 4' % len(arg))
309309
color = tuple(arg[:3])
310-
if [x for x in color if (float(x) < 0) or (x > 1)]:
310+
if [x for x in color if (float(x) < 0) or (x > 1)]:
311311
# This will raise TypeError if x is not a number.
312312
raise ValueError(
313313
'number in rbg sequence outside 0-1 range')
@@ -344,7 +344,7 @@ def to_rgba(self, arg, alpha=None):
344344
try:
345345
if not cbook.is_string_like(arg) and cbook.iterable(arg):
346346
if len(arg) == 4:
347-
if [x for x in arg if (float(x) < 0) or (x > 1)]:
347+
if [x for x in arg if (float(x) < 0) or (x > 1)]:
348348
# This will raise TypeError if x is not a number.
349349
raise ValueError(
350350
'number in rbga sequence outside 0-1 range')
@@ -354,7 +354,7 @@ def to_rgba(self, arg, alpha=None):
354354
raise ValueError("alpha must be in range 0-1")
355355
return arg[0], arg[1], arg[2], alpha
356356
r, g, b = arg[:3]
357-
if [x for x in (r, g, b) if (float(x) < 0) or (x > 1)]:
357+
if [x for x in (r, g, b) if (float(x) < 0) or (x > 1)]:
358358
raise ValueError(
359359
'number in rbg sequence outside 0-1 range')
360360
else:
@@ -1254,23 +1254,23 @@ def shade_rgb(self, rgb, elevation, fraction=1.):
12541254
hsv[:, :, 1] = np.where(np.logical_and(
12551255
np.abs(hsv[:, :, 1]) > 1.e-10,
12561256
intensity > 0),
1257-
(1. - intensity) * hsv[:, :, 1] + \
1257+
(1. - intensity) * hsv[:, :, 1] +
12581258
intensity * self.hsv_max_sat,
12591259
hsv[:, :, 1])
12601260

12611261
hsv[:, :, 2] = np.where(intensity > 0,
1262-
(1. - intensity) * hsv[:, :, 2] + \
1262+
(1. - intensity) * hsv[:, :, 2] +
12631263
intensity * self.hsv_max_val,
12641264
hsv[:, :, 2])
12651265

12661266
hsv[:, :, 1] = np.where(np.logical_and(
12671267
np.abs(hsv[:, :, 1]) > 1.e-10,
12681268
intensity < 0),
1269-
(1. + intensity) * hsv[:, :, 1] - \
1269+
(1. + intensity) * hsv[:, :, 1] -
12701270
intensity * self.hsv_min_sat,
12711271
hsv[:, :, 1])
12721272
hsv[:, :, 2] = np.where(intensity < 0,
1273-
(1. + intensity) * hsv[:, :, 2] -\
1273+
(1. + intensity) * hsv[:, :, 2] -
12741274
intensity * self.hsv_min_val,
12751275
hsv[:, :, 2])
12761276
hsv[:, :, 1:] = np.where(hsv[:, :, 1:] < 0., 0, hsv[:, :, 1:])

0 commit comments

Comments
 (0)