@@ -1439,6 +1439,21 @@ def aliased_name(self, s):
1439
1439
aliases = '' .join (' or %s' % x for x in sorted (self .aliasd .get (s , [])))
1440
1440
return s + aliases
1441
1441
1442
+ _NOT_LINKABLE = {
1443
+ # A set of property setter methods that are not available in our
1444
+ # current docs. This is a workaround used to prevent trying to link
1445
+ # these setters which would lead to "target reference not found"
1446
+ # warnings during doc build.
1447
+ 'matplotlib.image._ImageBase.set_alpha' ,
1448
+ 'matplotlib.image._ImageBase.set_array' ,
1449
+ 'matplotlib.image._ImageBase.set_data' ,
1450
+ 'matplotlib.image._ImageBase.set_filternorm' ,
1451
+ 'matplotlib.image._ImageBase.set_filterrad' ,
1452
+ 'matplotlib.image._ImageBase.set_interpolation' ,
1453
+ 'matplotlib.image._ImageBase.set_resample' ,
1454
+ 'matplotlib.text._AnnotationBase.set_annotation_clip' ,
1455
+ }
1456
+
1442
1457
def aliased_name_rest (self , s , target ):
1443
1458
"""
1444
1459
Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME',
@@ -1448,6 +1463,10 @@ def aliased_name_rest(self, s, target):
1448
1463
alias, return 'markerfacecolor or mfc' and for the transform
1449
1464
property, which does not, return 'transform'.
1450
1465
"""
1466
+ # workaround to prevent "reference target not found"
1467
+ if target in self ._NOT_LINKABLE :
1468
+ return f'``{ s } ``'
1469
+
1451
1470
aliases = '' .join (' or %s' % x for x in sorted (self .aliasd .get (s , [])))
1452
1471
return ':meth:`%s <%s>`%s' % (s , target , aliases )
1453
1472
@@ -1708,7 +1727,7 @@ def kwdoc(artist):
1708
1727
"""
1709
1728
ai = ArtistInspector (artist )
1710
1729
return ('\n ' .join (ai .pprint_setters_rest (leadingspace = 4 ))
1711
- if mpl .rcParams ['docstring.hardcopy' ] else
1730
+ if mpl .rcParams ['docstring.hardcopy' ] or True else
1712
1731
'Properties:\n ' + '\n ' .join (ai .pprint_setters (leadingspace = 4 )))
1713
1732
1714
1733
# We defer this to the end of them module, because it needs ArtistInspector
0 commit comments