diff --git a/doc/api/next_api_changes/deprecations/26329-AL.rst b/doc/api/next_api_changes/deprecations/26329-AL.rst new file mode 100644 index 000000000000..ca06e94639dd --- /dev/null +++ b/doc/api/next_api_changes/deprecations/26329-AL.rst @@ -0,0 +1,5 @@ +``axisartist.axes_grid`` and ``axisartist.axes_rgb`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +These modules, which provide wrappers combining the functionality of +`.axes_grid1` and `.axisartist`, are deprecated; directly use e.g. +``AxesGrid(..., axes_class=axislines.Axes)`` instead. diff --git a/lib/mpl_toolkits/axisartist/axes_grid.py b/lib/mpl_toolkits/axisartist/axes_grid.py index 27877a238b7d..ecb3e9d92c18 100644 --- a/lib/mpl_toolkits/axisartist/axes_grid.py +++ b/lib/mpl_toolkits/axisartist/axes_grid.py @@ -1,11 +1,21 @@ +from matplotlib import _api + import mpl_toolkits.axes_grid1.axes_grid as axes_grid_orig from .axislines import Axes +_api.warn_deprecated( + "3.8", name=__name__, obj_type="module", alternative="axes_grid1.axes_grid") + + +@_api.deprecated("3.8", alternative=( + "axes_grid1.axes_grid.Grid(..., axes_class=axislines.Axes")) class Grid(axes_grid_orig.Grid): _defaultAxesClass = Axes +@_api.deprecated("3.8", alternative=( + "axes_grid1.axes_grid.ImageGrid(..., axes_class=axislines.Axes")) class ImageGrid(axes_grid_orig.ImageGrid): _defaultAxesClass = Axes diff --git a/lib/mpl_toolkits/axisartist/axes_rgb.py b/lib/mpl_toolkits/axisartist/axes_rgb.py index 20c1f7fd233b..2195747469a1 100644 --- a/lib/mpl_toolkits/axisartist/axes_rgb.py +++ b/lib/mpl_toolkits/axisartist/axes_rgb.py @@ -1,8 +1,15 @@ +from matplotlib import _api from mpl_toolkits.axes_grid1.axes_rgb import ( # noqa make_rgb_axes, RGBAxes as _RGBAxes) from .axislines import Axes +_api.warn_deprecated( + "3.8", name=__name__, obj_type="module", alternative="axes_grid1.axes_rgb") + + +@_api.deprecated("3.8", alternative=( + "axes_grid1.axes_rgb.RGBAxes(..., axes_class=axislines.Axes")) class RGBAxes(_RGBAxes): """ Subclass of `~.axes_grid1.axes_rgb.RGBAxes` with