diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index a0e588569465..7c2d8d9f2f01 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2429,18 +2429,6 @@ def _update_patch_limits(self, patch): if (isinstance(patch, mpatches.Rectangle) and ((not patch.get_width()) and (not patch.get_height()))): return - p = patch.get_path() - # Get all vertices on the path - # Loop through each segment to get extrema for Bezier curve sections - vertices = [] - for curve, code in p.iter_bezier(simplify=False): - # Get distance along the curve of any extrema - _, dzeros = curve.axis_aligned_extrema() - # Calculate vertices of start, end and any extrema in between - vertices.append(curve([0, *dzeros, 1])) - - if len(vertices): - vertices = np.vstack(vertices) patch_trf = patch.get_transform() updatex, updatey = patch_trf.contains_branch_seperately(self.transData) @@ -2452,9 +2440,10 @@ def _update_patch_limits(self, patch): updatex = False if updatey and patch_trf == self.get_xaxis_transform(): updatey = False - trf_to_data = patch_trf - self.transData - xys = trf_to_data.transform(vertices) - self.update_datalim(xys, updatex=updatex, updatey=updatey) + self.dataLim.update_from_path(patch.get_path(), + self.ignore_existing_data_limits, + updatex=updatex, updatey=updatey) + self.ignore_existing_data_limits = False def add_table(self, tab): """