File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -984,9 +984,12 @@ def clf(self, keep_observers=False):
984984 """
985985 return self .clear (keep_observers = keep_observers )
986986
987- # Note: in the docstring below, the newlines in the examples after the
988- # calls to legend() allow replacing it with figlegend() to generate the
989- # docstring of pyplot.figlegend.
987+ # Note: the docstring below is modified with replace for the pyplot
988+ # version of this function because the method name differs (plt.figlegend)
989+ # the replacements are:
990+ # " legend(" -> " figlegend(" for the signatures
991+ # "fig.legend(" -> "plt.figlegend" for the code examples
992+ # "ax.plot" -> "plt.plot" for consistency in using pyplot when able
990993 @_docstring .dedent_interpd
991994 def legend (self , * args , ** kwargs ):
992995 """
Original file line number Diff line number Diff line change @@ -962,7 +962,10 @@ def savefig(*args, **kwargs):
962962def figlegend (* args , ** kwargs ):
963963 return gcf ().legend (* args , ** kwargs )
964964if Figure .legend .__doc__ :
965- figlegend .__doc__ = Figure .legend .__doc__ .replace ("legend(" , "figlegend(" )
965+ figlegend .__doc__ = Figure .legend .__doc__ \
966+ .replace (" legend(" , " figlegend(" ) \
967+ .replace ("fig.legend(" , "plt.figlegend(" ) \
968+ .replace ("ax.plot(" , "plt.plot(" )
966969
967970
968971## Axes ##
You can’t perform that action at this time.
0 commit comments