From c9fca8a4a4bdfa6acb27822591af1bac5d0fc898 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:40:24 +0200 Subject: [PATCH] DOC: Cross-link Axes attributes Follow up to #28825. --- lib/matplotlib/axes/_base.py | 6 +++--- lib/matplotlib/image.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index b9b2da1cb9fb..d49e6f10a54c 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2251,8 +2251,8 @@ def add_artist(self, a): Use `add_artist` only for artists for which there is no dedicated "add" method; and if necessary, use a method such as `update_datalim` - to manually update the dataLim if the artist is to be included in - autoscaling. + to manually update the `~.Axes.dataLim` if the artist is to be included + in autoscaling. If no ``transform`` has been specified when creating the artist (e.g. ``artist.get_transform() == None``) then the transform is set to @@ -2365,7 +2365,7 @@ def _add_text(self, txt): def _update_line_limits(self, line): """ - Figures out the data limit of the given line, updating self.dataLim. + Figures out the data limit of the given line, updating `.Axes.dataLim`. """ path = line.get_path() if path.vertices.size == 0: diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 2a7afbbe450c..9949eeec6ec2 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -919,10 +919,10 @@ def set_extent(self, extent, **kwargs): Notes ----- - This updates ``ax.dataLim``, and, if autoscaling, sets ``ax.viewLim`` - to tightly fit the image, regardless of ``dataLim``. Autoscaling - state is not changed, so following this with ``ax.autoscale_view()`` - will redo the autoscaling in accord with ``dataLim``. + This updates `.Axes.dataLim`, and, if autoscaling, sets `.Axes.viewLim` + to tightly fit the image, regardless of `~.Axes.dataLim`. Autoscaling + state is not changed, so following a subsequent call to `.Axes.autoscale_view`` + will redo the autoscaling in accord with `~.Axes.dataLim`. """ (xmin, xmax), (ymin, ymax) = self.axes._process_unit_info( [("x", [extent[0], extent[1]]),