

def compute_scale_and_translate(self, range, n):
    'Compute the scale and translate parameters for a linear transformation\n        ``output = s * input + t``, mapping from data space to axis space.\n\n        Parameters\n        ----------\n        range : tuple\n            A tuple representing the boundary inclusive range ``[min, max]``\n            along the axis, in data space.\n        n : int\n            The number of bins along the axis.\n\n        Returns\n        -------\n        s, t : floats\n            Parameters represe\n\n        '
    (start, end) = map(self.mapper, range)
    s = ((n - 1) / (end - start))
    t = ((- start) * s)
    return (s, t)

dataset/ETHPy150Open bokeh/datashader/datashader/core.py Axis.compute_scale_and_translate/original