MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / getp

Function getp

lib/matplotlib/artist.py:1792–1825  ·  view source on GitHub ↗

Return the value of an `.Artist`'s *property*, or print all of them. Parameters ---------- obj : `~matplotlib.artist.Artist` The queried artist; e.g., a `.Line2D`, a `.Text`, or an `~.axes.Axes`. property : str or None, default: None If *property* is 'somename'

(obj, property=None)

Source from the content-addressed store, hash-verified

1790
1791
1792def getp(obj, property=None):
1793 """
1794 Return the value of an `.Artist`'s *property*, or print all of them.
1795
1796 Parameters
1797 ----------
1798 obj : `~matplotlib.artist.Artist`
1799 The queried artist; e.g., a `.Line2D`, a `.Text`, or an `~.axes.Axes`.
1800
1801 property : str or None, default: None
1802 If *property* is 'somename', this function returns
1803 ``obj.get_somename()``.
1804
1805 If it's None (or unset), it *prints* all gettable properties from
1806 *obj*. Many properties have aliases for shorter typing, e.g. 'lw' is
1807 an alias for 'linewidth'. In the output, aliases and full property
1808 names will be listed as:
1809
1810 property or alias = value
1811
1812 e.g.:
1813
1814 linewidth or lw = 2
1815
1816 See Also
1817 --------
1818 setp
1819 """
1820 if property is None:
1821 insp = ArtistInspector(obj)
1822 ret = insp.pprint_getters()
1823 print('\n'.join(ret))
1824 return
1825 return getattr(obj, 'get_' + property)()
1826
1827# alias
1828get = getp

Callers

nothing calls this directly

Calls 3

pprint_gettersMethod · 0.95
ArtistInspectorClass · 0.85
joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…