matplotlib.artist.ArtistInspector#

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

Bases: object

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.

aliased_name(s)[source]#

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

For example, 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(s, target)[source]#

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

For example, 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()[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()[source]#

Get the attribute strings with setters for object.

For example, for a line, return ['markerfacecolor', 'linewidth', ....].

get_valid_values(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.

static is_alias(method)[source]#

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

static number_of_parameters(func)[source]#

Return number of parameters of the callable func.

pprint_getters()[source]#

Return the getters and actual values as list of strings.

pprint_setters(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(prop=None, leadingspace=4)[source]#

If prop is None, return a list of reST-formatted 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.

properties()[source]#

Return a dictionary mapping property name -> value.