From 7f9c788ab79a3534b65ec2bf97fd1ba03333983e Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sat, 6 May 2023 13:37:23 +0100 Subject: [PATCH] Remove kwargs from WCSAxes.draw() Add changelog Remove args, kwargs from _WCSAxesArtist.draw() --- astropy/visualization/wcsaxes/core.py | 6 +++--- docs/changes/visualization/14772.api.rst | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 docs/changes/visualization/14772.api.rst diff --git a/astropy/visualization/wcsaxes/core.py b/astropy/visualization/wcsaxes/core.py index f57845c38d4..8e98442e82d 100644 --- a/astropy/visualization/wcsaxes/core.py +++ b/astropy/visualization/wcsaxes/core.py @@ -41,7 +41,7 @@ class _WCSAxesArtist(Artist): and gridlines in the standary way. """ - def draw(self, renderer, *args, **kwargs): + def draw(self, renderer): self.axes.draw_wcsaxes(renderer) @@ -502,7 +502,7 @@ def draw_wcsaxes(self, renderer): self.coords.frame.draw(renderer) - def draw(self, renderer, **kwargs): + def draw(self, renderer): """Draw the axes.""" # Before we do any drawing, we need to remove any existing grid lines # drawn with contours, otherwise if we try and remove the contours @@ -533,7 +533,7 @@ def draw(self, renderer, **kwargs): # We need to make sure that that frame path is up to date self.coords.frame._update_patch_path() - super().draw(renderer, **kwargs) + super().draw(renderer) self._drawn = True diff --git a/docs/changes/visualization/14772.api.rst b/docs/changes/visualization/14772.api.rst new file mode 100644 index 00000000000..a9801c3b608 --- /dev/null +++ b/docs/changes/visualization/14772.api.rst @@ -0,0 +1,2 @@ +It is now not possible to pass any keyword arguments to ``astropy.visualization.wcsaxes.WCSAxes.draw()``. +Previously passing any keyword arguments would have errored anyway, as ``matplotlib.axes.Axes.draw()`` does not accept keyword arguments.