File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -949,13 +949,16 @@ def clear(self, keep_observers=False):
949
949
950
950
self .stale = True
951
951
952
- # synonym for `clear`.
953
- clf = clear
952
+ # synonym for `clear`. We do this with a property to make sure that we get
953
+ # a literal alias that correctly behaves for sub-classes (without resorting
954
+ # to __subclass_init__ or other meta-programming tools.
955
+ @property
956
+ def clf (self ):
957
+ return self .clear
954
958
955
959
# Note: in the docstring below, the newlines in the examples after the
956
960
# calls to legend() allow replacing it with figlegend() to generate the
957
961
# docstring of pyplot.figlegend.
958
-
959
962
@_docstring .dedent_interpd
960
963
def legend (self , * args , ** kwargs ):
961
964
"""
@@ -2848,9 +2851,6 @@ def clear(self, keep_observers=False):
2848
2851
if toolbar is not None :
2849
2852
toolbar .update ()
2850
2853
2851
- # synonym for `clear`.
2852
- clf = clear
2853
-
2854
2854
@_finalize_rasterization
2855
2855
@allow_rasterization
2856
2856
def draw (self , renderer ):
You can’t perform that action at this time.
0 commit comments