Returns the maximum number of ticks based on the scale dimension
348740
function() {
		var me = this;
		var tickFont;

		if (me.isHorizontal()) {
			return Math.ceil(me.width / 40);
		}
		tickFont = helpers.options._parseFont(me.options.ticks);
		return Math.ceil(me.height / tickFont.lineHeight);
	}
1142172
def _get_axis_dims(self, element):
        
        dims = element.dimensions()[:2]
        if len(dims) == 1:
            return dims + [None, None]
        else:
            return dims + [None]
641156
function getScales(xyMinMaxCurr, xyMinMaxOrigin) {
    var sizeCurr = getSize(xyMinMaxCurr);
    var sizeOrigin = getSize(xyMinMaxOrigin);
    var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];
    isNaN(scales[0]) && (scales[0] = 1);
    isNaN(scales[1]) && (scales[1] = 1);
    return scales;
}
1238695
def max(self, axis=None, skipna=True, *args, **kwargs):
        
        nv.validate_max(args, kwargs)
        nv.validate_minmax_axis(axis)

        if not len(self):
            return self._na_value

        i8 = self.asi8
        try:
            # quick check
            if len(i8) and self.is_monotonic:
                if i8[-1] != iNaT:
                    return self._box_func(i8[-1])

            if self.hasnans:
                if skipna:
                    max_stamp = self[~self._isnan].asi8.max()
                else:
                    return self._na_value
            else:
                max_stamp = i8.max()
            return self._box_func(max_stamp)
        except ValueError:
            return self._na_value
464271
public function computeScale($XMin, $XMax, $MaxDivs, array $Factors, $AxisID = 0)
    {
        /* Compute each factors */
        $Results = [];
        foreach ($Factors as $Key => $Factor) {
            $Results[$Factor] = $this->processScale($XMin, $XMax, $MaxDivs, [$Factor], $AxisID);
        }
        /* Remove scales that are creating to much decimals */
        $GoodScaleFactors = [];
        foreach ($Results as $Key => $Result) {
            $Decimals = preg_split("/\./", $Result["RowHeight"]);
            if ((!isset($Decimals[1])) || (strlen($Decimals[1]) < 6)) {
                $GoodScaleFactors[] = $Key;
            }
        }

        /* Found no correct scale, shame,... returns the 1st one as default */
        if (!count($GoodScaleFactors)) {
            return $Results[$Factors[0]];
        }

        /* Find the factor that cause the maximum number of Rows */
        $MaxRows = 0;
        $BestFactor = 0;
        foreach ($GoodScaleFactors as $Key => $Factor) {
            if ($Results[$Factor]["Rows"] > $MaxRows) {
                $MaxRows = $Results[$Factor]["Rows"];
                $BestFactor = $Factor;
            }
        }

        /* Return the best visual scale */
        return $Results[$BestFactor];
    }
859572
def max(self):
        
        return self._constructor(self.values.max(axis=self.baseaxes, keepdims=True))
261550
function generateTicks(generationOptions, dataRange) {
	var ticks = [];
	// To get a "nice" value for the tick spacing, we will use the appropriately named
	// "nice number" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks
	// for details.

	var MIN_SPACING = 1e-14;
	var stepSize = generationOptions.stepSize;
	var unit = stepSize || 1;
	var maxNumSpaces = generationOptions.maxTicks - 1;
	var min = generationOptions.min;
	var max = generationOptions.max;
	var precision = generationOptions.precision;
	var rmin = dataRange.min;
	var rmax = dataRange.max;
	var spacing = helpers$1.niceNum((rmax - rmin) / maxNumSpaces / unit) * unit;
	var factor, niceMin, niceMax, numSpaces;

	// Beyond MIN_SPACING floating point numbers being to lose precision
	// such that we can't do the math necessary to generate ticks
	if (spacing < MIN_SPACING && isNullOrUndef(min) && isNullOrUndef(max)) {
		return [rmin, rmax];
	}

	numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);
	if (numSpaces > maxNumSpaces) {
		// If the calculated num of spaces exceeds maxNumSpaces, recalculate it
		spacing = helpers$1.niceNum(numSpaces * spacing / maxNumSpaces / unit) * unit;
	}

	if (stepSize || isNullOrUndef(precision)) {
		// If a precision is not specified, calculate factor based on spacing
		factor = Math.pow(10, helpers$1._decimalPlaces(spacing));
	} else {
		// If the user specified a precision, round to that number of decimal places
		factor = Math.pow(10, precision);
		spacing = Math.ceil(spacing * factor) / factor;
	}

	niceMin = Math.floor(rmin / spacing) * spacing;
	niceMax = Math.ceil(rmax / spacing) * spacing;

	// If min, max and stepSize is set and they make an evenly spaced scale use it.
	if (stepSize) {
		// If very close to our whole number, use it.
		if (!isNullOrUndef(min) && helpers$1.almostWhole(min / spacing, spacing / 1000)) {
			niceMin = min;
		}
		if (!isNullOrUndef(max) && helpers$1.almostWhole(max / spacing, spacing / 1000)) {
			niceMax = max;
		}
	}

	numSpaces = (niceMax - niceMin) / spacing;
	// If very close to our rounded value, use it.
	if (helpers$1.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {
		numSpaces = Math.round(numSpaces);
	} else {
		numSpaces = Math.ceil(numSpaces);
	}

	niceMin = Math.round(niceMin * factor) / factor;
	niceMax = Math.round(niceMax * factor) / factor;
	ticks.push(isNullOrUndef(min) ? niceMin : min);
	for (var j = 1; j < numSpaces; ++j) {
		ticks.push(Math.round((niceMin + j * spacing) * factor) / factor);
	}
	ticks.push(isNullOrUndef(max) ? niceMax : max);

	return ticks;
}
960356
function () {

            var chart = this.chart,
              maxTicks = chart.maxTicks || {},
              tickPositions = this.tickPositions,
              key = this._maxTicksKey = [this.coll, this.pos, this.len].join('-');

            if (!this.isLinked && !this.isDatetimeAxis && tickPositions && tickPositions.length > (maxTicks[key] || 0) && this.options.alignTicks !== false) {
                maxTicks[key] = tickPositions.length;
            }
            chart.maxTicks = maxTicks;
        }
951874
def xAxisIsMajor(self):
        '''
        
        '''
        return max(self.radius.x, self.radius.y) == self.radius.x
1303454
def scaleY(self, canvasY):
        ''
        plotterY = super().scaleY(canvasY)
        return (self.plotviewBox.ymax-plotterY+4)
248763
def max(self, axis=None, skipna=True):
        """"""
        nv.validate_minmax_axis(axis)
        return self._minmax('max')
1180866
def max_min_projection(self, axis=2):
        
        if axis >= size(self.value_shape):
            raise Exception('Axis for projection (%s) exceeds '
                            'image dimensions (%s-%s)' % (axis, 0, size(self.value_shape)-1))

        new_value_shape = list(self.value_shape)
        del new_value_shape[axis]
        return self.map(lambda x: amax(x, axis) + amin(x, axis), value_shape=new_value_shape)
700439
def _draw_tickgram(numbers):
    
    max_number = max(filter(lambda x : type(x)==int,numbers))
    # If the maxium number is 0, then all the numbers should be 0
    # coz we have called handle_negatives prior to this function
    if max_number == 0 :
        return upticks[0]*len(numbers)
    else:
        normalized_numbers = [ float(x)/max_number if type(x)==int else x for x in numbers ]
        upticks_indexes = [ int(math.ceil(x*len(upticks))) if type(x)==float else x for x in normalized_numbers ]
        return ''.join([ ' ' if type(x)==str else upticks[x-1] if x != 0 else upticks[0] for x in upticks_indexes ])
433338
def get_max(self,*args,**kwargs):
        
        if len(args) == 1:
            return self.spike_times.get_label(args[0]).max
        return [self.spike_times.get_label(a).max for a in args]
1194137
function adjustTickAmounts() {
		if (optionsChart.alignTicks !== false) {
			each(axes, function (axis) {
				axis.adjustTickAmount();
			});
		}
		maxTicks = null;
	}
70700
def scale(self):
        
        if self.__scale:
            return self.__scale
        v = max(self.screenshot().size) / max(self.window_size())
        self.__scale = round(v)
        return self.__scale
930918
def legend_scaler(legend_values, max_labels=10.0):
    
    if len(legend_values) < max_labels:
        legend_ticks = legend_values
    else:
        spacer = int(math.ceil(len(legend_values)/max_labels))
        legend_ticks = []
        for i in legend_values[::spacer]:
            legend_ticks += [i]
            legend_ticks += ['']*(spacer-1)
    return legend_ticks