File tree 2 files changed +19
-1
lines changed 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1467,7 +1467,7 @@ def tables(self):
1467
1467
1468
1468
@property
1469
1469
def texts (self ):
1470
- return self .ArtistList (self , 'texts' , 'add_text ' ,
1470
+ return self .ArtistList (self , 'texts' , 'add_artist ' ,
1471
1471
valid_types = mtext .Text )
1472
1472
1473
1473
def clear (self ):
Original file line number Diff line number Diff line change @@ -7233,6 +7233,24 @@ def test_artist_sublists():
7233
7233
assert not ax .lines
7234
7234
assert not ax .tables
7235
7235
7236
+ with pytest .warns (MatplotlibDeprecationWarning ,
7237
+ match = 'modification of the Axes.texts property' ):
7238
+ ax .texts .append (text )
7239
+ with pytest .warns (MatplotlibDeprecationWarning ,
7240
+ match = 'modification of the Axes.collections property' ):
7241
+ ax .collections .append (col )
7242
+ with pytest .warns (MatplotlibDeprecationWarning ,
7243
+ match = 'modification of the Axes.images property' ):
7244
+ ax .images .append (im )
7245
+ with pytest .warns (MatplotlibDeprecationWarning ,
7246
+ match = 'modification of the Axes.patches property' ):
7247
+ ax .patches .append (patch )
7248
+ # verify things are back
7249
+ assert list (ax .collections ) == [col ]
7250
+ assert list (ax .images ) == [im ]
7251
+ assert list (ax .patches ) == [patch ]
7252
+ assert list (ax .texts ) == [text ]
7253
+
7236
7254
# Adding items should warn.
7237
7255
with pytest .warns (MatplotlibDeprecationWarning ,
7238
7256
match = 'modification of the Axes.lines property' ):
You can’t perform that action at this time.
0 commit comments