Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dd08ab0 + 95f4003 commit 0b741eeCopy full SHA for 0b741ee
3 files changed
doc/api/next_api_changes/deprecations/20237-TH.rst
@@ -3,11 +3,11 @@ QuadMesh signature
3
The ``QuadMesh`` signature ::
4
5
def __init__(meshWidth, meshHeight, coordinates,
6
- antialiased=True, shading=False, **kwargs)
+ antialiased=True, shading='flat', **kwargs)
7
8
is deprecated and replaced by the new signature ::
9
10
- def __init__(coordinates, *, antialiased=True, shading=False, **kwargs)
+ def __init__(coordinates, *, antialiased=True, shading='flat', **kwargs)
11
12
In particular:
13
lib/matplotlib/collections.py
@@ -2002,15 +2002,15 @@ def __init__(self, *args, **kwargs):
2002
# The following raises a TypeError iif the args don't match.
2003
w, h, coords, antialiased, shading, kwargs = (
2004
lambda meshWidth, meshHeight, coordinates, antialiased=True,
2005
- shading=False, **kwargs:
+ shading='flat', **kwargs:
2006
(meshWidth, meshHeight, coordinates, antialiased, shading,
2007
kwargs))(*args, **kwargs)
2008
except TypeError as exc:
2009
# New signature:
2010
# If the following raises a TypeError (i.e. args don't match),
2011
# just let it propagate.
2012
coords, antialiased, shading, kwargs = (
2013
- lambda coordinates, antialiased=True, shading=False, **kwargs:
+ lambda coordinates, antialiased=True, shading='flat', **kwargs:
2014
(coordinates, antialiased, shading, kwargs))(*args, **kwargs)
2015
coords = np.asarray(coords, np.float64)
2016
else: # The old signature matched.
lib/matplotlib/tests/test_collections.py
@@ -743,6 +743,7 @@ def test_quadmesh_deprecated_signature(
743
qmesh = QuadMesh(coords, **kwargs)
744
qmesh.set_array(C)
745
ax.add_collection(qmesh)
746
+ assert qmesh._shading == 'flat'
747
748
ax = fig_ref.add_subplot()
749
ax.set(xlim=(0, 5), ylim=(0, 4))
@@ -754,6 +755,7 @@ def test_quadmesh_deprecated_signature(
754
755
**kwargs)
756
qmesh.set_array(C.flatten() if flat_ref else C)
757
758
759
760
761
@check_figures_equal(extensions=['png'])
0 commit comments