MCPcopy Index your code
hub / github.com/bqplot/bqplot / bin

Function bin

bqplot/pyplot.py:831–857  ·  view source on GitHub ↗

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

(sample, options={}, **kwargs)

Source from the content-addressed store, hash-verified

829
830@_process_data()
831def bin(sample, options={}, **kwargs):
832 """Draw a histogram in the current context figure.
833 Parameters
834 ----------
835 sample: numpy.ndarray, 1d
836 The sample for which the histogram must be generated.
837 options: dict (default: {})
838 Options for the scales to be created. If a scale labeled 'x'
839 is required for that mark, options['x'] contains optional keyword
840 arguments for the constructor of the corresponding scale type.
841 axes_options: dict (default: {})
842 Options for the axes to be created. If an axis labeled 'x' is
843 required for that mark, axes_options['x'] contains optional
844 keyword arguments for the constructor of the corresponding axis type.
845 """
846 kwargs['sample'] = sample
847 scales = kwargs.pop('scales', {})
848 for xy in ['x', 'y']:
849 if xy not in scales:
850 dimension = _get_attribute_dimension(xy, Bars)
851 if dimension in _context['scales']:
852 scales[xy] = _context['scales'][dimension]
853 else:
854 scales[xy] = LinearScale(**options.get(xy, {}))
855 _context['scales'][dimension] = scales[xy]
856 kwargs['scales'] = scales
857 return _draw_mark(Bins, options=options, **kwargs)
858
859
860@_process_data('color')

Callers

nothing calls this directly

Calls 2

_get_attribute_dimensionFunction · 0.85
_draw_markFunction · 0.85

Tested by

no test coverage detected