Recompute the data limits based on current artists. Parameters ---------- visible_only : bool, default: False Whether to exclude invisible artists.
(self, visible_only=False)
| 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 | """ |