@@ -2425,6 +2425,7 @@ def add_image(self, image):
24252425 self ._children .append (image )
24262426 image ._remove_method = self ._children .remove
24272427 self .stale = True
2428+ image ._set_in_autoscale (True )
24282429 return image
24292430
24302431 def _update_image_limits (self , image ):
@@ -2446,6 +2447,7 @@ def add_line(self, line):
24462447 self ._children .append (line )
24472448 line ._remove_method = self ._children .remove
24482449 self .stale = True
2450+ line ._set_in_autoscale (True )
24492451 return line
24502452
24512453 def _add_text (self , txt ):
@@ -2518,6 +2520,7 @@ def add_patch(self, p):
25182520 self ._update_patch_limits (p )
25192521 self ._children .append (p )
25202522 p ._remove_method = self ._children .remove
2523+ p ._set_in_autoscale (True )
25212524 return p
25222525
25232526 def _update_patch_limits (self , patch ):
@@ -2615,6 +2618,8 @@ def relim(self, visible_only=False):
26152618
26162619 for artist in self ._children :
26172620 if not visible_only or artist .get_visible ():
2621+ if not artist ._get_in_autoscale ():
2622+ continue
26182623 if isinstance (artist , mlines .Line2D ):
26192624 self ._update_line_limits (artist )
26202625 elif isinstance (artist , mpatches .Patch ):
0 commit comments