Version 2.2.2
matplotlib
Fork me on GitHub

matplotlib.artist.ArtistInspector

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

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)[source]

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 PROPNAME.
aliased_name_rest(s, target) return ‘PROPNAME or alias’ if s has an alias, else return PROPNAME formatted for ReST
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)[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(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()[source]

Get a dict mapping fullname -> alias 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. e.g., 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 function set_attr for a line that begins with “ACCEPTS” or “.. ACCEPTS”:

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

is_alias(o)[source]

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

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 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()[source]

return a dictionary mapping property name -> value