You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.0.0b1.post7580.dev0+ge487118
matplotlib
Fork me on GitHub

This Page

matplotlib.artist.ArtistInspector

class matplotlib.artist.ArtistInspector(o)

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

Initialize the artist inspector with an Artist or 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__(o)

Initialize the artist inspector with an Artist or 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__(o) Initialize the artist inspector with an Artist or iterable of Artists.
aliased_name(s) return ‘PROPNAME or alias’ if s has an alias, else return
aliased_name_rest(s, target) return ‘PROPNAME or alias’ if s has an alias, else return
get_aliases() Get a dict mapping fullname -> alias for each alias in the ArtistInspector.
get_setters() Get the attribute strings with setters for object.
get_valid_values(attr) Get the legal arguments for the setter associated with attr.
is_alias(o) Return True if method object o is an alias for another function.
pprint_getters() Return the getters and actual values as list of strings.
pprint_setters([prop, leadingspace]) If prop is None, return a list of strings of all settable properties and their valid values.
pprint_setters_rest([prop, leadingspace]) If prop is None, return a list of strings of all settable properties and their valid values.
properties() return a dictionary mapping property name -> value
aliased_name(s)

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(s, target)

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()

Get a dict mapping fullname -> alias for each alias in the ArtistInspector.

e.g., for lines:

{'markerfacecolor': 'mfc',
 'linewidth'      : 'lw',
}
get_setters()

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

get_valid_values(attr)

Get the legal arguments for the setter associated with attr.

This is done by querying the docstring of the function set_attr for a line that begins with “ACCEPTS” or “.. ACCEPTS”:

e.g., for a line linestyle, return “[ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]”

is_alias(o)

Return True if method object o is an alias for another function.

pprint_getters()

Return the getters and actual values as list of strings.

pprint_setters(prop=None, leadingspace=2)

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=2)

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()

return a dictionary mapping property name -> value