Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0ee8e81

Browse files
Throw exception when alpha is out of bounds
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
1 parent 5f922ff commit 0ee8e81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎lib/matplotlib/colors.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ def with_alpha(self, alpha):
949949
if not isinstance(alpha, Real):
950950
raise TypeError(f"'alpha' must be numeric or None, not {type(alpha)}")
951951
if not 0 <= alpha <= 1:
952-
ValueError("'alpha' must be between 0 and 1, inclusive")
952+
raiseValueError("'alpha' must be between 0 and 1, inclusive")
953953
new_cm = self.copy()
954954
if not new_cm._isinit:
955955
new_cm._init()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /