Set limits or all axis the same, if vmax not given, use [-vmin, vmin].
515501
def xyzlim(vmin, vmax=None):
    """"""
    if vmax is None:
        vmin, vmax = -vmin, vmin
    xlim(vmin, vmax)
    ylim(vmin, vmax)
    zlim(vmin, vmax)
248763
def max(self, axis=None, skipna=True):
        """"""
        nv.validate_minmax_axis(axis)
        return self._minmax('max')
474502
private float limit(float value, float min, float max) {
    return Math.min(Math.max(min, value), max);
  }
862192
private void checkVerticalLimit(double extrp, double vy)
    {
        // Inside interval
        if (mover.getY() >= limitBottom
            && mover.getY() <= limitTop
            && limitBottom != Integer.MIN_VALUE
            && limitTop != Integer.MAX_VALUE)
        {
            offset.moveLocation(extrp, 0, vy);

            // Block offset on its limits
            if (offset.getY() < -intervalVertical)
            {
                offset.teleportY(-intervalVertical);
            }
            else if (offset.getY() > intervalVertical)
            {
                offset.teleportY(intervalVertical);
            }
        }
        // Outside interval
        if ((int) offset.getY() == -intervalVertical || (int) offset.getY() == intervalVertical)
        {
            mover.moveLocationY(extrp, vy);
        }
        applyVerticalLimit();
    }
833546
private void updateMax(int idx, double v) {
    AtomicLong current = max.getCurrent(idx);
    long m = current.get();
    while (v > Double.longBitsToDouble(m)) {
      if (current.compareAndSet(m, Double.doubleToLongBits(v))) {
        break;
      }
      m = current.get();
    }
  }
166461
def __expand_limits(ax, limits, which='x'):
    ''''''

    if which == 'x':
        getter, setter = ax.get_xlim, ax.set_xlim
    elif which == 'y':
        getter, setter = ax.get_ylim, ax.set_ylim
    else:
        raise ValueError('invalid axis: {}'.format(which))

    old_lims = getter()
    new_lims = list(limits)

    # infinite limits occur on new axis objects with no data
    if np.isfinite(old_lims[0]):
        new_lims[0] = min(old_lims[0], limits[0])

    if np.isfinite(old_lims[1]):
        new_lims[1] = max(old_lims[1], limits[1])

    setter(new_lims)
1218639
def set_polar_box(self, rmin=0, rmax=1, tmin=0, tmax=2 * pi):
        """"""
        self._rmin = rmin
        self._rmax = rmax
        self._tmin = tmin
        self._tmax = tmax
        self.xmin = self.ymin = rmin - rmax
        self.xmax = self.ymax = rmax - rmin
1018428
private void checkHorizontalLimit(double extrp, double vx)
    {
        // Inside interval
        if (mover.getX() >= limitLeft
            && mover.getX() <= limitRight
            && limitLeft != Integer.MIN_VALUE
            && limitRight != Integer.MAX_VALUE)
        {
            offset.moveLocation(extrp, vx, 0);

            // Block offset on its limits
            if (offset.getX() < -intervalHorizontal)
            {
                offset.teleportX(-intervalHorizontal);
            }
            else if (offset.getX() > intervalHorizontal)
            {
                offset.teleportX(intervalHorizontal);
            }
        }
        // Outside interval
        if ((int) offset.getX() == -intervalHorizontal || (int) offset.getX() == intervalHorizontal)
        {
            mover.moveLocationX(extrp, vx);
        }
        applyHorizontalLimit();
    }
1195246
def scale_to_control(x, axis_scale=350., min_v=-1.0, max_v=1.0):
    """"""
    x = x / axis_scale
    x = min(max(x, min_v), max_v)
    return x
539107
def _setuplimits(self, constraints):
        """"""
        self.constraints = tuple(constraints)
        assert len(self.constraints) == self.fmodel.dim_x
        self.goal = None
200118
def setbb(self, x, y):
        """"""
        self.__xmin = min(self.__xmin, max(x, self.__clip_box[0]))
        self.__xmax = max(self.__xmax, min(x, self.__clip_box[2]))
        self.__ymin = min(self.__ymin, max(y, self.__clip_box[1]))
        self.__ymax = max(self.__ymax, min(y, self.__clip_box[3]))
1348623
def _constrain_pan(self):
        """"""
        if self.xmin is not None and self.xmax is not None:
            p0 = self.xmin + 1. / self._zoom[0]
            p1 = self.xmax - 1. / self._zoom[0]
            p0, p1 = min(p0, p1), max(p0, p1)
            self._pan[0] = np.clip(self._pan[0], p0, p1)

        if self.ymin is not None and self.ymax is not None:
            p0 = self.ymin + 1. / self._zoom[1]
            p1 = self.ymax - 1. / self._zoom[1]
            p0, p1 = min(p0, p1), max(p0, p1)
            self._pan[1] = np.clip(self._pan[1], p0, p1)
618108
private void applyMax(Dimension dim) {
	if (getMaxHeight() > 0) {
	  dim.height = Math.min(dim.height, getMaxHeight());
	}
	if (getMaxWidth() > 0) {
	  dim.width = Math.min(dim.width, getMaxWidth());
	}
  }
149142
def _set_axis_limits(self, axis, view, subplots, ranges):
        
        # Extents
        extents = self.get_extents(view, ranges)
        if not extents or self.overlaid:
            axis.autoscale_view(scalex=True, scaley=True)
            return

        valid_lim = lambda c: util.isnumeric(c) and not np.isnan(c)
        coords = [coord if np.isreal(coord) or isinstance(coord, np.datetime64) else np.NaN for coord in extents]
        coords = [date2num(util.dt64_to_dt(c)) if isinstance(c, np.datetime64) else c
                  for c in coords]
        if self.projection == '3d' or len(extents) == 6:
            l, b, zmin, r, t, zmax = coords
            if self.invert_zaxis or any(p.invert_zaxis for p in subplots):
                zmin, zmax = zmax, zmin
            if zmin != zmax:
                if valid_lim(zmin):
                    axis.set_zlim(bottom=zmin)
                if valid_lim(zmax):
                    axis.set_zlim(top=zmax)
        else:
            l, b, r, t = coords

        if self.invert_axes:
            l, b, r, t = b, l, t, r

        invertx = self.invert_xaxis or any(p.invert_xaxis for p in subplots)
        xlim, scalex = self._compute_limits(l, r, self.logx, invertx, 'left', 'right')
        inverty = self.invert_yaxis or any(p.invert_yaxis for p in subplots)
        ylim, scaley =  self._compute_limits(b, t, self.logy, inverty, 'bottom', 'top')
        if xlim:
            axis.set_xlim(**xlim)
        if ylim:
            axis.set_ylim(**ylim)
        axis.autoscale_view(scalex=scalex, scaley=scaley)
371920
private void updateMinMax(NumberVector featureVector, double[] minima, double[] maxima) {
    assert (minima.length == featureVector.getDimensionality());
    for(int d = 0; d < featureVector.getDimensionality(); d++) {
      double v = featureVector.doubleValue(d);
      if(v == v) { // Avoid NaN.
        maxima[d] = MathUtil.max(v, maxima[d]);
        minima[d] = MathUtil.min(v, minima[d]);
      }
    }
  }
1122254
def update_plot_limits(ax, white_space):
    

    if hasattr(ax, 'zz_dataLim'):
        bounds = ax.xy_dataLim.bounds
        ax.set_xlim(bounds[0] - white_space, bounds[0] + bounds[2] + white_space)
        ax.set_ylim(bounds[1] - white_space, bounds[1] + bounds[3] + white_space)

        bounds = ax.zz_dataLim.bounds
        ax.set_zlim(bounds[0] - white_space, bounds[0] + bounds[2] + white_space)
    else:
        bounds = ax.dataLim.bounds
        assert not any(map(np.isinf, bounds)), 'Cannot set bounds if dataLim has infinite elements'
        ax.set_xlim(bounds[0] - white_space, bounds[0] + bounds[2] + white_space)
        ax.set_ylim(bounds[1] - white_space, bounds[1] + bounds[3] + white_space)
423436
def set_values(self, values):
        """"""
        self.values = values
        self.height = len(self.values) * 14
        self._max = max(rec[1] for rec in values) if values else dt.timedelta(0)