From 68266ef52a6e1d266614aca3040b430ade3c2c07 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 26 Apr 2023 13:24:59 +0200 Subject: [PATCH] Small axislines.Axes cleanups. - Deprecate the "callable axes" API, which is not present anywhere else nor documented nor tested. - No need to set the transform on the GridlinesCollection; _set_artist_props takes care of that. --- doc/api/next_api_changes/deprecations/25774-AL.rst | 4 ++++ lib/mpl_toolkits/axisartist/axislines.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 doc/api/next_api_changes/deprecations/25774-AL.rst diff --git a/doc/api/next_api_changes/deprecations/25774-AL.rst b/doc/api/next_api_changes/deprecations/25774-AL.rst new file mode 100644 index 000000000000..0b47d4ebffe7 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/25774-AL.rst @@ -0,0 +1,4 @@ +Callable axisartist Axes +~~~~~~~~~~~~~~~~~~~~~~~~ +Calling an axisartist Axes to mean `~pyplot.axis` is deprecated; explicitly +call the method instead. diff --git a/lib/mpl_toolkits/axisartist/axislines.py b/lib/mpl_toolkits/axisartist/axislines.py index e63c3b39646c..35717da8eaa9 100644 --- a/lib/mpl_toolkits/axisartist/axislines.py +++ b/lib/mpl_toolkits/axisartist/axislines.py @@ -407,6 +407,7 @@ def get_gridlines(self, which="major", axis="both"): class Axes(maxes.Axes): + @_api.deprecated("3.8", alternative="ax.axis") def __call__(self, *args, **kwargs): return maxes.Axes.axis(self.axes, *args, **kwargs) @@ -440,7 +441,7 @@ def clear(self): # Init gridlines before clear() as clear() calls grid(). self.gridlines = gridlines = GridlinesCollection( - [], transform=self.transData, + [], colors=mpl.rcParams['grid.color'], linestyles=mpl.rcParams['grid.linestyle'], linewidths=mpl.rcParams['grid.linewidth']) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy