8000 Backport PR #18079: Set shading='auto' if invalid value passed to pco… · matplotlib/matplotlib@a048285 · GitHub
[go: up one dir, main page]

Skip to content

Commit a048285

Browse files
jklymakmeeseeksmachine
authored andcommitted
Backport PR #18079: Set shading='auto' if invalid value passed to pcolormesh
1 parent 2286a32 commit a048285

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
@@ -5543,6 +5543,15 @@ def _pcolorargs(funcname, *args, shading='flat'):
55435543
# - reset shading if shading='auto' to flat or nearest
55445544
# depe 8000 nding on size;
55455545

5546+
_valid_shading = ['gouraud', 'nearest', 'flat', 'auto']
5547+
try:
5548+
cbook._check_in_list(_valid_shading, shading=shading)
5549+
except ValueError as err:
5550+
cbook._warn_external(f"shading value '{shading}' not in list of "
5551+
f"valid values {_valid_shading}. Setting "
5552+
"shading='auto'.")
5553+
shading = 'auto'
5554+
55465555
if len(args) == 1:
55475556
C = np.asanyarray(args[0])
55485557
nrows, ncols = C.shape

0 commit comments

Comments
 (0)
0