Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96dcd30

Browse files
committed
Set shading='auto' if invalid value passed
1 parent 4b179b9 commit 96dcd30

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5549,6 +5549,15 @@ def _pcolorargs(funcname, *args, shading='flat'):
55495549
# - reset shading if shading='auto' to flat or nearest
55505550
# depending on size;
55515551

5552+
_valid_shading = ['gouraud', 'nearest', 'flat', 'auto']
5553+
try:
5554+
cbook._check_in_list(_valid_shading, shading=shading)
5555+
except ValueError as err:
5556+
cbook._warn_external(f"shading value '{shading}' not in list of "
5557+
f"valid values {_valid_shading}. Setting "
5558+
"shading='auto'.")
5559+
shading = 'auto'
5560+
55525561
if len(args) == 1:
55535562
C = np.asanyarray(args[0])
55545563
nrows, ncols = C.shape

0 commit comments

Comments
 (0)