Draw a histogram in the current context figure.
    Parameters
    ----------
    sample: numpy.ndarray, 1d
        The sample for which the histogram must be generated.
    options: dict (default: {})
        Options for the scales to be created. If a scale labeled 'x'
        is required for that mark, options['x'] contains optional keyword
        arguments for the constructor of the corresponding scale type.
    axes_options: dict (default: {})
        Options for the axes to be created. If an axis labeled 'x' is
        required for that mark, axes_options['x'] contains optional
        keyword arguments for the constructor of the corresponding axis type.

def bin(sample, options={}, **kwargs):
    """Draw a histogram in the current context figure.
    Parameters
    ----------
    sample: numpy.ndarray, 1d
        The sample for which the histogram must be generated.
    options: dict (default: {})
        Options for the scales to be created. If a scale labeled 'x'
        is required for that mark, options['x'] contains optional keyword
        arguments for the constructor of the corresponding scale type.
    axes_options: dict (default: {})
        Options for the axes to be created. If an axis labeled 'x' is
        required for that mark, axes_options['x'] contains optional
        keyword arguments for the constructor of the corresponding axis type.
    """
    kwargs['sample'] = sample
    scales = kwargs.pop('scales', {})
    for xy in ['x', 'y']:
        if xy not in scales:
            dimension = _get_attribute_dimension(xy, Bars)
            if dimension in _context['scales']:
                scales[xy] = _context['scales'][dimension]
            else:
                scales[xy] = LinearScale(**options.get(xy, {}))
                _context['scales'][dimension] = scales[xy]
    kwargs['scales'] = scales
    return _draw_mark(Bins, options=options, **kwargs)