Set yaxis limits.

        Parameters
        ----------
        low : number
        high : number
        index : int, optional

        Returns
        -------
        Chart
550853
def ylim(self, low, high, index=1):
        
        self.layout['yaxis' + str(index)]['range'] = [low, high]
        return self
1200214
def sigmoid_range(x, low, high):
    ""
    return torch.sigmoid(x) * (high - low) + low
47329
def widen(self, other):
        
        if self.low < other.low:
            low = -float("inf")
        else:
            low = self.low
        if self.high > other.high:
            high = float("inf")
        else:
            high = self.high
        return Interval(low, high)
404479
def _adjust_limits(self):
        
        if not self.is_load:
#            self.p_min = min([point[0] for point in self.p_cost])
            self.p_max = max([point[0] for point in self.p_cost])
        else:
            p_min = min([point[0] for point in self.p_cost])
            self.p_max = 0.0
            self.q_min = self.q_min * p_min / self.p_min
            self.q_max = self.q_max * p_min / self.p_min
            self.p_min = p_min
117137
function _SubRange(low, high) {
    this.low = low;
    this.high = high;
    this.length = 1 + high - low;
}
1134141
def init_limit(self, key, lower=None, upper=None, limit=False):
        
        above = agtb(self.__dict__[key], upper)
        for idx, item in enumerate(above):
            if item == 0.:
                continue
            maxval = upper[idx]
            self.log(
                '{0} <{1}.{2}> above its maximum of {3}.'.format(
                    self.name[idx], self._name, key, maxval), ERROR)
            if limit:
                self.__dict__[key][idx] = maxval

        below = altb(self.__dict__[key], lower)
        for idx, item in enumerate(below):
            if item == 0.:
                continue
            minval = lower[idx]
            self.log(
                '{0} <{1}.{2}> below its minimum of {3}.'.format(
                    self.name[idx], self._name, key, minval), ERROR)
            if limit:
                self.__dict__[key][idx] = minval
64890
def set_limits(self, min_=None, max_=None):
        
        self._min, self._max = min_, max_
432916
def clamp(n, lower, upper):
    
    if lower > upper:
        lower, upper = upper, lower
    return max(min(upper, n), lower)
603340
def get_minimum_span(low, high, span):
    
    if is_number(low) and low == high:
        if isinstance(low, np.datetime64):
            span = span * np.timedelta64(1, 's')
        low, high = low-span, high+span
    return low, high
1359675
private void updateUpperXValue() {
        double upper = 1.0;
        if (this.measures != null) {
            upper = max_x_value * (1 + (0.1 / x_resolution));
        }

        this.axesPanel.setUpperXValue(upper);
        this.plotPanel.setUpperXValue(upper);
    }
1335500
def set_ylim_cb(self, redraw=True):
        """"""
        try:
            ymin = float(self.w.y_lo.get_text())
        except Exception:
            set_min = True
        else:
            set_min = False

        try:
            ymax = float(self.w.y_hi.get_text())
        except Exception:
            set_max = True
        else:
            set_max = False

        if set_min or set_max:
            self.tab_plot.draw()
            self.set_ylimits_widgets(set_min=set_min, set_max=set_max)

        if not (set_min and set_max):
            self.tab_plot.ax.set_ylim(ymin, ymax)
            if redraw:
                self.tab_plot.draw()
483837
def low_limit(self) -> Optional[Union[int, float]]:
        
        return self._get_field_value(SpecialDevice.PROP_LOW_LIMIT)
1007436
def setAutoRangeOn(self, axisNumber):
        
        setXYAxesAutoRangeOn(self, self.xAxisRangeCti, self.yAxisRangeCti, axisNumber)
485987
def control_high_limit(self) -> Optional[Union[int, float]]:
        
        return self._get_field_value(SpecialDevice.PROP_CONTROL_HIGH_LIMIT)
946979
def limit_x(
        self,
        limit_lower = None, # float
        limit_upper = None  # float
        ):

        

        if limit_lower is None and limit_upper is None:
            return self._limit_x
        elif hasattr(limit_lower, "__iter__"):
            self._limit_x = limit_lower[:2]
        else:
            self._limit_x = [limit_lower, limit_upper]
        if self._limit_x[0] == self._limit_x[1]:
            self._limit_x[1] += 1
        self._limit_x[0] -= self.mod_x
        self._limit_x[1] += self.mod_x
1086927
def make_tophat_ei (lower, upper):
    
    if not np.isfinite (lower):
        raise ValueError ('"lower" argument must be finite number; got %r' % lower)
    if not np.isfinite (upper):
        raise ValueError ('"upper" argument must be finite number; got %r' % upper)

    def range_tophat_ei (x):
        x = np.asarray (x)
        x1 = np.atleast_1d (x)
        r = ((lower < x1) & (x1 <= upper)).astype (x.dtype)
        if x.ndim == 0:
            return np.asscalar (r)
        return r

    range_tophat_ei.__doc__ = ('Ranged tophat function, left-exclusive and '
                               'right-inclusive. Returns 1 if %g < x <= %g, '
                               '0 otherwise.') % (lower, upper)
    return range_tophat_ei
1150827
def set_scale_limits(self, scale_min, scale_max):
        
        # TODO: force scale to within limits if already outside?
        self.t_.set(scale_min=scale_min, scale_max=scale_max)