File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -4303,13 +4303,16 @@ def invalid_shape_exception(csize, xsize):
4303
4303
try : # Is 'c' acceptable as PathCollection facecolors?
4304
4304
colors = mcolors .to_rgba_array (c )
4305
4305
except (TypeError , ValueError ) as err :
4306
- if not valid_shape :
4307
- raise invalid_shape_exception (c .size , xsize ) from err
4308
- # Both the mapping *and* the RGBA conversion failed: pretty
4309
- # severe failure => one may appreciate a verbose feedback.
4310
- raise ValueError (
4311
- f"'c' argument must be a color, a sequence of colors, or "
4312
- f"a sequence of numbers, not { c } " ) from err
4306
+ if "RGBA values should be within 0-1 range" in str (err ):
4307
+ raise
4308
+ else :
4309
+ if not valid_shape :
4310
+ raise invalid_shape_exception (c .size , xsize ) from err
4311
+ # Both the mapping *and* the RGBA conversion failed: pretty
4312
+ # severe failure => one may appreciate a verbose feedback.
4313
+ raise ValueError (
4314
+ f"'c' argument must be a color, a sequence of colors, "
4315
+ f"or a sequence of numbers, not { c } " ) from err
4313
4316
else :
4314
4317
if len (colors ) not in (0 , 1 , xsize ):
4315
4318
# NB: remember that a single color is also acceptable.
You can’t perform that action at this time.
0 commit comments