@@ -2336,23 +2336,15 @@ def _update_line_limits(self, line):
23362336 updatex = updatex , updatey = updatey )
23372337 self .ignore_existing_data_limits = False
23382338
2339- def add_patch (self , p , relim = True ):
2339+ def add_patch (self , p ):
23402340 """
23412341 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.
23492342 """
23502343 self ._deprecate_noninstance ('add_patch' , mpatches .Patch , p = p )
23512344 self ._set_artist_props (p )
23522345 if p .get_clip_path () is None :
23532346 p .set_clip_path (self .patch )
2354- if relim :
2355- self ._update_patch_limits (p )
2347+ self ._update_patch_limits (p )
23562348 self ._children .append (p )
23572349 p ._remove_method = self ._children .remove
23582350 return p
@@ -2377,6 +2369,8 @@ def _update_patch_limits(self, patch):
23772369 return
23782370 patch_trf = patch .get_transform ()
23792371 updatex , updatey = patch_trf .contains_branch_seperately (self .transData )
2372+ if not (updatex or updatey ):
2373+ return
23802374 if self .name != "rectilinear" :
23812375 # As in _update_line_limits, but for axvspan.
23822376 if updatex and patch_trf == self .get_yaxis_transform ():
0 commit comments