class matplotlib.docstring.Substitution(*args, **kwargs)[source]

Bases: object

A decorator that performs %-substitution on an object's docstring.

This decorator should be robust even if obj.__doc__ is None (for example, if -OO was passed to the interpreter).

Usage: construct a docstring.Substitution with a sequence or dictionary suitable for performing substitution; then decorate a suitable function with the constructed object, e.g.:

sub_author_name = Substitution(author='Jason')

def some_function(x):
    "%(author)s wrote this function"

# note that some_function.__doc__ is now "Jason wrote this function"

One can also use positional arguments:

sub_first_last_names = Substitution('Edgar Allen', 'Poe')

def some_function(x):
    "%s %s wrote the Raven"
update(*args, **kwargs)[source]

Update self.params (which must be a dict) with the supplied args.


Copy a docstring from another source function (if present).