Skip to content

Commit fc70e19

Browse files
committed
Replaces default value of shading from False to 'flat' in Quadmesh
1 parent 08f4629 commit fc70e19

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/matplotlib/collections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,15 +2002,15 @@ def __init__(self, *args, **kwargs):
20022002
# The following raises a TypeError iif the args don't match.
20032003
w, h, coords, antialiased, shading, kwargs = (
20042004
lambda meshWidth, meshHeight, coordinates, antialiased=True,
2005-
shading=False, **kwargs:
2005+
shading='flat', **kwargs:
20062006
(meshWidth, meshHeight, coordinates, antialiased, shading,
20072007
kwargs))(*args, **kwargs)
20082008
except TypeError as exc:
20092009
# New signature:
20102010
# If the following raises a TypeError (i.e. args don't match),
20112011
# just let it propagate.
20122012
coords, antialiased, shading, kwargs = (
2013-
lambda coordinates, antialiased=True, shading=False, **kwargs:
2013+
lambda coordinates, antialiased=True, shading='flat', **kwargs:
20142014
(coordinates, antialiased, shading, kwargs))(*args, **kwargs)
20152015
coords = np.asarray(coords, np.float64)
20162016
else: # The old signature matched.

lib/matplotlib/tests/test_collections.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,8 @@ def test_quadmesh_deprecated_signature(
744744
qmesh.set_array(C)
745745
ax.add_collection(qmesh)
746746

747+
assert qmesh._shading == 'flat'
748+
747749
ax = fig_ref.add_subplot()
748750
ax.set(xlim=(0, 5), ylim=(0, 4))
749751
if 'transform' in kwargs:

0 commit comments

Comments
 (0)