Histogram Mark
In [1]:
Copied!
import genstudio.plot as Plot
import genstudio.plot as Plot
The histogram
mark is a convenient extension that combines a rectY mark with a binX transform.
It accepts a list or array-like object of values and supports the various bin options such as thresholds
, interval
, domain
, and cumulative
as keyword arguments.
Here's a basic example:
In [2]:
Copied!
histogram_data = [1, 2, 2, 3, 3, 3, 4, 4, 5]
Plot.histogram(histogram_data)
histogram_data = [1, 2, 2, 3, 3, 3, 4, 4, 5]
Plot.histogram(histogram_data)
Out[2]:
You can customize the number of bins:
In [3]:
Copied!
Plot.histogram(histogram_data, thresholds=5)
Plot.histogram(histogram_data, thresholds=5)
Out[3]: