@@ -2336,23 +2336,15 @@ def _update_line_limits(self, line):
2336
2336
updatex = updatex , updatey = updatey )
2337
2337
self .ignore_existing_data_limits = False
2338
2338
2339
- def add_patch (self , p , relim = True ):
2339
+ def add_patch (self , p ):
2340
2340
"""
2341
2341
Add a `.Patch` to the Axes; return the patch.
2342
-
2343
- Parameters
2344
- ----------
2345
- p : `.Patch`
2346
- Patch to add to the axes.
2347
- relim : bool, default True
2348
- Whether the patch triggers an axes relim.
2349
2342
"""
2350
2343
self ._deprecate_noninstance ('add_patch' , mpatches .Patch , p = p )
2351
2344
self ._set_artist_props (p )
2352
2345
if p .get_clip_path () is None :
2353
2346
p .set_clip_path (self .patch )
2354
- if relim :
2355
- self ._update_patch_limits (p )
2347
+ self ._update_patch_limits (p )
2356
2348
self ._children .append (p )
2357
2349
p ._remove_method = self ._children .remove
2358
2350
return p
@@ -2377,6 +2369,8 @@ def _update_patch_limits(self, patch):
2377
2369
return
2378
2370
patch_trf = patch .get_transform ()
2379
2371
updatex , updatey = patch_trf .contains_branch_seperately (self .transData )
2372
+ if not (updatex or updatey ):
2373
+ return
2380
2374
if self .name != "rectilinear" :
2381
2375
# As in _update_line_limits, but for axvspan.
2382
2376
if updatex and patch_trf == self .get_yaxis_transform ():
0 commit comments