matplotlib.artist.ArtistInspector

class matplotlib.artist.ArtistInspector(o) [source]

A helper class to inspect an Artist and return information about its settable properties and their current values.

Initialize the artist inspector with an Artist or an iterable of Artists. If an iterable is used, we assume it is a homogeneous sequence (all Artists are of the same type) and it is your responsibility to make sure this is so.

__init__(self, o) [source]

Initialize the artist inspector with an Artist or an iterable of Artists. If an iterable is used, we assume it is a homogeneous sequence (all Artists are of the same type) and it is your responsibility to make sure this is so.

Methods

__init__(self, o) Initialize the artist inspector with an Artist or an iterable of Artists.
aliased_name(self, s) Return 'PROPNAME or alias' if s has an alias, else return 'PROPNAME'.
aliased_name_rest(self, s, target) Return 'PROPNAME or alias' if s has an alias, else return 'PROPNAME', formatted for ReST.
get_aliases(self) Get a dict mapping property fullnames to sets of aliases for each alias in the ArtistInspector.
get_setters(self) Get the attribute strings with setters for object.
get_valid_values(self, attr) Get the legal arguments for the setter associated with attr.
is_alias(self, o) Return whether method object o is an alias for another method.
pprint_getters(self) Return the getters and actual values as list of strings.
pprint_setters(self[, prop, leadingspace]) If prop is None, return a list of strings of all settable properties and their valid values.
pprint_setters_rest(self[, prop, leadingspace]) If prop is None, return a list of strings of all settable properties and their valid values.
properties(self) Return a dictionary mapping property name -> value.
aliased_name(self, s) [source]

Return 'PROPNAME or alias' if s has an alias, else return 'PROPNAME'.

e.g., for the line markerfacecolor property, which has an alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform'.

aliased_name_rest(self, s, target) [source]

Return 'PROPNAME or alias' if s has an alias, else return 'PROPNAME', formatted for ReST.

e.g., for the line markerfacecolor property, which has an alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform'.

get_aliases(self) [source]

Get a dict mapping property fullnames to sets of aliases for each alias in the ArtistInspector.

e.g., for lines:

{'markerfacecolor': {'mfc'},
 'linewidth'      : {'lw'},
}
get_setters(self) [source]

Get the attribute strings with setters for object. e.g., for a line, return ['markerfacecolor', 'linewidth', ....].

get_valid_values(self, attr) [source]

Get the legal arguments for the setter associated with attr.

This is done by querying the docstring of the setter for a line that begins with "ACCEPTS:" or ".. ACCEPTS:", and then by looking for a numpydoc-style documentation for the setter's first argument.

is_alias(self, o) [source]

Return whether method object o is an alias for another method.

pprint_getters(self) [source]

Return the getters and actual values as list of strings.

pprint_setters(self, prop=None, leadingspace=2) [source]

If prop is None, return a list of strings of all settable properties and their valid values.

If prop is not None, it is a valid property name and that property will be returned as a string of property : valid values.

pprint_setters_rest(self, prop=None, leadingspace=4) [source]

If prop is None, return a list of strings of all settable properties and their valid values. Format the output for ReST

If prop is not None, it is a valid property name and that property will be returned as a string of property : valid values.

properties(self) [source]

Return a dictionary mapping property name -> value.

© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.artist.ArtistInspector.html