MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / relim

Method relim

lib/matplotlib/axes/_base.py:2654–2678  ·  view source on GitHub ↗

Recompute the data limits based on current artists. Parameters ---------- visible_only : bool, default: False Whether to exclude invisible artists.

(self, visible_only=False)

Source from the content-addressed store, hash-verified

2652 self._request_autoscale_view(axis_name)
2653
2654 def relim(self, visible_only=False):
2655 """
2656 Recompute the data limits based on current artists.
2657
2658 Parameters
2659 ----------
2660 visible_only : bool, default: False
2661 Whether to exclude invisible artists.
2662 """
2663 self.dataLim.ignore(True)
2664 self.dataLim.set_points(mtransforms.Bbox.null().get_points())
2665 self.ignore_existing_data_limits = True
2666
2667 for artist in self._children:
2668 if not visible_only or artist.get_visible():
2669 if not artist._get_in_autoscale():
2670 continue
2671 if isinstance(artist, mlines.Line2D):
2672 self._update_line_limits(artist)
2673 elif isinstance(artist, mpatches.Patch):
2674 self._update_patch_limits(artist)
2675 elif isinstance(artist, mimage.AxesImage):
2676 self._update_image_limits(artist)
2677 elif isinstance(artist, mcoll.Collection):
2678 self._update_collection_limits(artist)
2679
2680 def update_datalim(self, xys, updatex=True, updatey=True):
2681 """

Callers 9

_unit_change_handlerMethod · 0.95
test_relim_visible_onlyFunction · 0.80
test_relim_collectionFunction · 0.80
test_relimFunction · 0.80
packed_bubbles.pyFile · 0.80
submitFunction · 0.80

Calls 10

_update_line_limitsMethod · 0.95
_update_patch_limitsMethod · 0.95
_update_image_limitsMethod · 0.95
set_pointsMethod · 0.80
nullMethod · 0.80
_get_in_autoscaleMethod · 0.80
ignoreMethod · 0.45
get_pointsMethod · 0.45
get_visibleMethod · 0.45

Tested by 6

test_relim_visible_onlyFunction · 0.64
test_relim_collectionFunction · 0.64
test_relimFunction · 0.64