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 'counts' is required for
(sample, options={}, **kwargs)
| 799 | |
| 800 | @_process_data() |
| 801 | def hist(sample, options={}, **kwargs): |
| 802 | """Draw a histogram in the current context figure. |
| 803 | |
| 804 | Parameters |
| 805 | ---------- |
| 806 | sample: numpy.ndarray, 1d |
| 807 | The sample for which the histogram must be generated. |
| 808 | options: dict (default: {}) |
| 809 | Options for the scales to be created. If a scale labeled 'counts' |
| 810 | is required for that mark, options['counts'] contains optional keyword |
| 811 | arguments for the constructor of the corresponding scale type. |
| 812 | axes_options: dict (default: {}) |
| 813 | Options for the axes to be created. If an axis labeled 'counts' is |
| 814 | required for that mark, axes_options['counts'] contains optional |
| 815 | keyword arguments for the constructor of the corresponding axis type. |
| 816 | """ |
| 817 | kwargs['sample'] = sample |
| 818 | scales = kwargs.pop('scales', {}) |
| 819 | if 'count' not in scales: |
| 820 | dimension = _get_attribute_dimension('count', Hist) |
| 821 | if dimension in _context['scales']: |
| 822 | scales['count'] = _context['scales'][dimension] |
| 823 | else: |
| 824 | scales['count'] = LinearScale(**options.get('count', {})) |
| 825 | _context['scales'][dimension] = scales['count'] |
| 826 | kwargs['scales'] = scales |
| 827 | return _draw_mark(Hist, options=options, **kwargs) |
| 828 | |
| 829 | |
| 830 | @_process_data() |
nothing calls this directly
no test coverage detected
searching dependent graphs…