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

Class Bins

bqplot/marks.py:1158–1257  ·  view source on GitHub ↗

Backend histogram mark. A `Bars` instance that bins sample data. It is very similar in purpose to the `Hist` mark, the difference being that the binning is done in the backend (python), which avoids large amounts of data being shipped back and forth to the frontend. It should there

Source from the content-addressed store, hash-verified

1156
1157@register_mark('bqplot.Bins')
1158class Bins(Bars):
1159
1160 """Backend histogram mark.
1161
1162 A `Bars` instance that bins sample data.
1163
1164 It is very similar in purpose to the `Hist` mark, the difference being that
1165 the binning is done in the backend (python), which avoids large amounts of
1166 data being shipped back and forth to the frontend. It should therefore be
1167 preferred for large data.
1168 The binning method is the numpy `histogram` method.
1169
1170 The following documentation is in part taken from the numpy documentation.
1171
1172 Data Attributes
1173 ---------------
1174
1175 Attributes
1176 ----------
1177 sample: numpy.ndarray (default: [])
1178 sample of which the histogram must be computed.
1179
1180 Style Attributes
1181 ----------------
1182
1183 Attributes
1184 ----------
1185 icon: string (class-level attribute)
1186 font-awesome icon for that mark
1187 name: string (class-level attribute)
1188 user-friendly name of the mark
1189 bins: nonnegative int (default: 10)
1190 or {'auto', 'fd', 'doane', 'scott', 'rice', 'sturges', 'sqrt'}
1191 If `bins` is an int, it defines the number of equal-width
1192 bins in the given range (10, by default).
1193 If `bins` is a string (method name), `histogram` will use
1194 the method chosen to calculate the optimal bin width and
1195 consequently the number of bins (see `Notes` for more detail on
1196 the estimators) from the data that falls within the requested
1197 range.
1198 density : bool (default: `False`)
1199 If `False`, the height of each bin is the number of samples in it.
1200 If `True`, the height of each bin is the value of the
1201 probability *density* function at the bin, normalized such that
1202 the *integral* over the range is 1. Note that the sum of the
1203 histogram values will not be equal to 1 unless bins of unity
1204 width are chosen; it is not a probability *mass* function.
1205 min : float (default: None)
1206 The lower range of the bins. If not provided, lower range
1207 is simply `x.min()`.
1208 max : float (default: None)
1209 The upper range of the bins. If not provided, lower range
1210 is simply `x.max()`.
1211
1212 !!! Note
1213 - The fields which can be passed to the default tooltip are:
1214 - All the `Bars` data attributes (`x`, `y`, `color`)
1215 - **index**: index of the bin

Callers

nothing calls this directly

Calls 1

array_dimension_boundsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…