Repository: matplotlib/matplotlib
File: lib/matplotlib/axes/_base.py (Python)

Code before:
                    artist.sticky_edges.y
                    for ax in self._shared_y_axes.get_siblings(self)
                    if hasattr(ax, "lines")
                    for artist in ax.get_children()]))
        if self.get_xscale().lower() == 'log':
            x_stickies = x_stickies[x_stickies > 0]
        if self.get_yscale().lower() == 'log':
            y_stickies = y_stickies[y_stickies > 0]

        def handle_single_axis(scale, autoscaleon, shared_axes, interval,
                               minpos, axis, margin, stickies, set_bound):

            if not (scale and autoscaleon):
                return  # nothing to do...

            shared = shared_axes.get_siblings(self)
            # Base autoscaling on finite data limits when there is at least one
            # finite data limit among all the shared_axes and intervals.
            # Also, find the minimum minpos for use in the margin calculation.
            x_values = []
            minimum_minpos = np.inf
            for ax in shared:
                x_values.extend(getattr(ax.dataLim, interval))
                minimum_minpos = np.min(
                    [minimum_minpos, getattr(ax.dataLim, minpos)]
                )
            x_values = np.extract(np.isfinite(x_values), x_values)
            if x_values.size >= 1:
                x0, x1 = (x_values.min(), x_values.max())
            else:
                x0, x1 = (-np.inf, np.inf)
            # If x0 and x1 are non finite, use the locator to figure out
            # default limits.
            locator = axis.get_major_locator()
            x0, x1 = locator.nonsingular(x0, x1)

            # Prevent margin addition from crossing a sticky value.  A small
            # tolerance must be added due to floating point issues with
            # streamplot; it is defined relative to x0, x1, x1-x0 but has
            # no absolute term (e.g. "+1e-8") to avoid issues when working with
            # datasets where all values are tiny (less than 1e-8).
            tol = 1e-5 * max(abs(x0), abs(x1), abs(x1 - x0))
            # Index of largest element < x0 + tol, if any.
            i0 = stickies.searchsorted(x0 + tol) - 1
            x0bound = stickies[i0] if i0 != -1 else None
            # Index of smallest element > x1 - tol, if any.
            i1 = stickies.searchsorted(x1 - tol)
            x1bound = stickies[i1] if i1 != len(stickies) else None

            # Add the margin in figure space and then transform back, to handle
            # non-linear scales.

Review comment (suggestion):
Can you not use plain `min`, which requires less arrays?
```suggestion
                minimum_minpos = min(minimum_minpos,
                                     getattr(ax.dataLim, minpos))
```

Code after:
                    artist.sticky_edges.y
                    for ax in self._shared_y_axes.get_siblings(self)
                    if hasattr(ax, "lines")
                    for artist in ax.get_children()]))
        if self.get_xscale().lower() == 'log':
            x_stickies = x_stickies[x_stickies > 0]
        if self.get_yscale().lower() == 'log':
            y_stickies = y_stickies[y_stickies > 0]

        def handle_single_axis(scale, autoscaleon, shared_axes, interval,
                               minpos, axis, margin, stickies, set_bound):

            if not (scale and autoscaleon):
                return  # nothing to do...

            shared = shared_axes.get_siblings(self)
            # Base autoscaling on finite data limits when there is at least one
            # finite data limit among all the shared_axes and intervals.
            # Also, find the minimum minpos for use in the margin calculation.
            x_values = []
            minimum_minpos = np.inf
            for ax in shared:
                x_values.extend(getattr(ax.dataLim, interval))
                minimum_minpos = min(minimum_minpos,
                                     getattr(ax.dataLim, minpos))
            x_values = np.extract(np.isfinite(x_values), x_values)
            if x_values.size >= 1:
                x0, x1 = (x_values.min(), x_values.max())
            else:
                x0, x1 = (-np.inf, np.inf)
            # If x0 and x1 are non finite, use the locator to figure out
            # default limits.
            locator = axis.get_major_locator()
            x0, x1 = locator.nonsingular(x0, x1)

            # Prevent margin addition from crossing a sticky value.  A small
            # tolerance must be added due to floating point issues with
            # streamplot; it is defined relative to x0, x1, x1-x0 but has
            # no absolute term (e.g. "+1e-8") to avoid issues when working with
            # datasets where all values are tiny (less than 1e-8).
            tol = 1e-5 * max(abs(x0), abs(x1), abs(x1 - x0))
            # Index of largest element < x0 + tol, if any.
            i0 = stickies.searchsorted(x0 + tol) - 1
            x0bound = stickies[i0] if i0 != -1 else None
            # Index of smallest element > x1 - tol, if any.
            i1 = stickies.searchsorted(x1 - tol)
            x1bound = stickies[i1] if i1 != len(stickies) else None

            # Add the margin in figure space and then transform back, to handle
            # non-linear scales.
            transform = axis.get_transform()