Skip to content

Commit 896d680

Browse files
committed
MNT: deprecate draw method args and kwargs
1 parent d2cc4d0 commit 896d680

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``[XYZ]Axis.draw``, ``*Image.draw`` *args* and *kwargs*...
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
... are deprecated because they have no effect. This will make the calling sequence
5+
consistent with the ``draw`` method of other artists.

galleries/examples/misc/demo_ribbon_box.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ def __init__(self, ax, bbox, color, *, extent=(0, 1, 0, 1), **kwargs):
4949
self._ribbonbox = RibbonBox(color)
5050
self.set_transform(BboxTransformTo(bbox))
5151

52-
def draw(self, renderer, *args, **kwargs):
52+
def draw(self, renderer):
5353
stretch_factor = self._bbox.height / self._bbox.width
5454

5555
ny = int(stretch_factor*self._ribbonbox.nx)
5656
if self.get_array() is None or self.get_array().shape[0] != ny:
5757
arr = self._ribbonbox.get_stretched_image(stretch_factor)
5858
self.set_array(arr)
5959

60-
super().draw(renderer, *args, **kwargs)
60+
super().draw(renderer)
6161

6262

6363
def main():

lib/matplotlib/axis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,8 @@ def get_tick_padding(self):
13731373
values.append(self.minorTicks[0].get_tick_padding())
13741374
return max(values, default=0)
13751375

1376+
@_api.delete_parameter('3.9', 'args')
1377+
@_api.delete_parameter('3.9', 'kwargs')
13761378
@martist.allow_rasterization
13771379
def draw(self, renderer, *args, **kwargs):
13781380
# docstring inherited

lib/matplotlib/image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ def _check_unsampled_image(self):
626626
"""
627627
return False
628628

629+
@_api.delete_parameter('3.9', 'args')
630+
@_api.delete_parameter('3.9', 'kwargs')
629631
@martist.allow_rasterization
630632
def draw(self, renderer, *args, **kwargs):
631633
# if not visible, declare victory and return

0 commit comments

Comments
 (0)