Skip to content

Commit cb55075

Browse files
committed
DOC: Fix non-working code object references
These were not rendered as links in the current docs, because the associated code objects do not exist as targets in the docs. For some reason, sphinx did not complain about it. But it does in some recent PRs (extracted from #28560) - I'm unclear why, but anyway the correct solution is to change to explicitly listing the attributes.
1 parent 56153b9 commit cb55075

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

doc/api/axes_api.rst

+11
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ The Axes class
2828

2929
Axes
3030

31+
Attributes
32+
----------
33+
34+
.. autosummary::
35+
:toctree: _as_gen
36+
:template: autosummary.rst
37+
:nosignatures:
38+
39+
Axes.viewLim
40+
Axes.dataLim
41+
3142
Plotting
3243
========
3344

lib/matplotlib/axes/_axes.py

-7
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ class Axes(_AxesBase):
8585
methods instead; e.g. from `.pyplot` or `.Figure`:
8686
`~.pyplot.subplots`, `~.pyplot.subplot_mosaic` or `.Figure.add_axes`.
8787
88-
Attributes
89-
----------
90-
dataLim : `.Bbox`
91-
The bounding box enclosing all data displayed in the Axes.
92-
viewLim : `.Bbox`
93-
The view limits in data coordinates.
94-
9588
"""
9689
### Labelling, legend and texts
9790

lib/matplotlib/axes/_base.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ class _AxesBase(martist.Artist):
551551

552552
_subclass_uses_cla = False
553553

554+
dataLim: mtransforms.Bbox
555+
"""The bounding `.Bbox` enclosing all data displayed in the Axes."""
556+
554557
@property
555558
def _axis_map(self):
556559
"""A mapping of axis names, e.g. 'x', to `Axis` instances."""
@@ -849,6 +852,7 @@ def _unstale_viewLim(self):
849852

850853
@property
851854
def viewLim(self):
855+
"""The view limits as `.Bbox` in data coordinates."""
852856
self._unstale_viewLim()
853857
return self._viewLim
854858

@@ -2265,7 +2269,7 @@ def add_artist(self, a):
22652269

22662270
def add_child_axes(self, ax):
22672271
"""
2268-
Add an `.AxesBase` to the Axes' children; return the child Axes.
2272+
Add an `.Axes` to the Axes' children; return the child Axes.
22692273
22702274
This is the lowlevel version. See `.axes.Axes.inset_axes`.
22712275
"""

0 commit comments

Comments
 (0)