2121 # This function was autogenerated by boilerplate.py. Do not edit as
2222# changes will be lost
2323def %(func)s(%(argspec)s):
24- %(docstring)s
2524 %(ax)s = gca()
2625 # allow callers to override the hold state by passing hold=True|False
2726 %(washold)s = %(ax)s.ishold()
@@ -35,16 +34,19 @@ def %(func)s(%(argspec)s):
3534 %(ax)s.hold(%(washold)s)
3635 %(mappable)s
3736 return %(ret)s
37+ if Axes.%(func)s.__doc__ is not None:
38+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + __docstring_addendum
3839"""
3940
4041_fmtmisc = """\
4142 # This function was autogenerated by boilerplate.py. Do not edit as
4243# changes will be lost
4344def %(func)s(%(argspec)s):
44- %(docstring)s
4545 %(ret)s = gca().%(func)s(%(call)s)
4646 draw_if_interactive()
4747 return %(ret)s
48+ if Axes.%(func)s.__doc__ is not None:
49+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__)
4850"""
4951
5052# these methods are all simple wrappers of Axes methods by the same
@@ -138,19 +140,6 @@ def remove_final_whitespace(string):
138140 """
139141 return '\n ' .join (x .rstrip () for x in string .split ('\n ' ))
140142
141- def make_docstring (cmd , mention_hold ):
142- func = getattr (Axes , cmd )
143- docstring = inspect .getdoc (func )
144- if docstring is None :
145- return ""
146- escaped = re .sub (r'\\' , r'\\\\' , docstring )
147- if mention_hold :
148- escaped += '''
149-
150- Additional kwargs: hold = [True|False] overrides default hold state
151- '''
152- return '"""' + escaped + '"""'
153-
154143for fmt ,cmdlist in (_fmtplot ,_plotcommands ),(_fmtmisc ,_misccommands ):
155144 for func in cmdlist :
156145 # For some commands, an additional line is needed to set the
@@ -160,9 +149,6 @@ def make_docstring(cmd, mention_hold):
160149 else :
161150 mappable = ''
162151
163- # Format docstring
164- docstring = make_docstring (func , fmt is _fmtplot )
165-
166152 # Get argspec of wrapped function
167153 args , varargs , varkw , defaults = inspect .getargspec (getattr (Axes , func ))
168154 args .pop (0 ) # remove 'self' argument
0 commit comments