8000 Merge pull request #18083 from meeseeksmachine/auto-backport-of-pr-18… · matplotlib/matplotlib@3a523d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3a523d9

Browse files
authored
Merge pull request #18083 from meeseeksmachine/auto-backport-of-pr-18079-on-v3.3.x
Backport PR #18079 on branch v3.3.x (Set shading='auto' if invalid value passed to pcolormesh)
2 parents 2286a32 + a048285 commit 3a523d9

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
# depending 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