diff --git a/doc/missing-references.json b/doc/missing-references.json index 5cc11217caad..a4bcf34b016a 100644 --- a/doc/missing-references.json +++ b/doc/missing-references.json @@ -143,38 +143,6 @@ ] }, "py:meth": { - "matplotlib.collections._CollectionWithSizes.set_sizes": [ - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.barbs:180", - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.broken_barh:85", - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.fill_between:122", - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.fill_betweenx:122", - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.hexbin:218", - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.pcolor:187", - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.quiver:256", - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.scatter:174", - "lib/matplotlib/collections.py:docstring of matplotlib.artist.AsteriskPolygonCollection.set:45", - "lib/matplotlib/collections.py:docstring of matplotlib.artist.CircleCollection.set:45", - "lib/matplotlib/collections.py:docstring of matplotlib.artist.FillBetweenPolyCollection.set:46", - "lib/matplotlib/collections.py:docstring of matplotlib.artist.PathCollection.set:45", - "lib/matplotlib/collections.py:docstring of matplotlib.artist.PolyCollection.set:45", - "lib/matplotlib/collections.py:docstring of matplotlib.artist.PolyQuadMesh.set:45", - "lib/matplotlib/collections.py:docstring of matplotlib.artist.RegularPolyCollection.set:45", - "lib/matplotlib/collections.py:docstring of matplotlib.artist.StarPolygonCollection.set:45", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.barbs:180", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.broken_barh:85", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.fill_between:122", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.fill_betweenx:122", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.hexbin:218", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.pcolor:187", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.quiver:256", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.scatter:174", - "lib/matplotlib/quiver.py:docstring of matplotlib.artist.Barbs.set:46", - "lib/matplotlib/quiver.py:docstring of matplotlib.artist.Quiver.set:46", - "lib/matplotlib/quiver.py:docstring of matplotlib.quiver.Barbs:213", - "lib/matplotlib/quiver.py:docstring of matplotlib.quiver.Quiver:292", - "lib/mpl_toolkits/mplot3d/art3d.py:docstring of matplotlib.artist.Path3DCollection.set:47", - "lib/mpl_toolkits/mplot3d/art3d.py:docstring of matplotlib.artist.Poly3DCollection.set:46" - ], "matplotlib.collections._MeshData.set_array": [ "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.pcolormesh:168", "lib/matplotlib/collections.py:docstring of matplotlib.artist.PolyQuadMesh.set:17", diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index c87c789048c4..3bab582ad001 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -1572,6 +1572,13 @@ def aliased_name(self, s): 'matplotlib.image._ImageBase.set_resample', 'matplotlib.text._AnnotationBase.set_annotation_clip', } + _LINK_IN_CHILD_CLASS = { + # A set of property setter methods that are inherited, and where the + # original method is not part of the docs (e.g. because it's in a private + # base class which is not documented), but the method is documented in + # the class itself because of :inherited-members:. + '_CollectionWithSizes.set_sizes', + } def aliased_name_rest(self, s, target): """ @@ -1640,8 +1647,12 @@ def pprint_setters_rest(self, prop=None, leadingspace=4): break else: # No docstring available. method = getattr(self.o, f"set_{prop}") - prop_and_qualnames.append( - (prop, f"{method.__module__}.{method.__qualname__}")) + + if method.__qualname__ in self._LINK_IN_CHILD_CLASS: + qualname = f"{method.__module__}.{self.o.__name__}.{method.__name__}" + else: + qualname = f"{method.__module__}.{method.__qualname__}" + prop_and_qualnames.append((prop, qualname)) names = [self.aliased_name_rest(prop, target) .replace('_base._AxesBase', 'Axes')