File tree 2 files changed +10
-4
lines changed 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -979,9 +979,12 @@ def clf(self, keep_observers=False):
979
979
"""
980
980
return self .clear (keep_observers = keep_observers )
981
981
982
- # Note: in the docstring below, the newlines in the examples after the
983
- # calls to legend() allow replacing it with figlegend() to generate the
984
- # docstring of pyplot.figlegend.
982
+ # Note: the docstring below is modified with replace for the pyplot
983
+ # version of this function because the method name differs (plt.figlegend)
984
+ # the replacements are:
985
+ # " legend(" -> " figlegend(" for the signatures
986
+ # "fig.legend(" -> "plt.figlegend" for the code examples
987
+ # "ax.plot" -> "plt.plot" for consistency in using pyplot when able
985
988
@_docstring .dedent_interpd
986
989
def legend (self , * args , ** kwargs ):
987
990
"""
Original file line number Diff line number Diff line change @@ -980,7 +980,10 @@ def savefig(*args, **kwargs):
980
980
def figlegend (* args , ** kwargs ):
981
981
return gcf ().legend (* args , ** kwargs )
982
982
if Figure .legend .__doc__ :
983
- figlegend .__doc__ = Figure .legend .__doc__ .replace ("legend(" , "figlegend(" )
983
+ figlegend .__doc__ = Figure .legend .__doc__ \
984
+ .replace (" legend(" , " figlegend(" ) \
985
+ .replace ("fig.legend(" , "plt.figlegend(" ) \
986
+ .replace ("ax.plot(" , "plt.plot(" )
984
987
985
988
986
989
## Axes ##
You can’t perform that action at this time.
0 commit comments