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 @@ -984,9 +984,12 @@ def clf(self, keep_observers=False):
984
984
"""
985
985
return self .clear (keep_observers = keep_observers )
986
986
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
990
993
@_docstring .dedent_interpd
991
994
def legend (self , * args , ** kwargs ):
992
995
"""
Original file line number Diff line number Diff line change @@ -962,7 +962,10 @@ def savefig(*args, **kwargs):
962
962
def figlegend (* args , ** kwargs ):
963
963
return gcf ().legend (* args , ** kwargs )
964
964
if 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(" )
966
969
967
970
968
971
## Axes ##
You can’t perform that action at this time.
0 commit comments