turicreate.visualization.histogram

turicreate.visualization.histogram(sa, xlabel='__TURI_DEFAULT_LABEL', ylabel='__TURI_DEFAULT_LABEL', title='__TURI_DEFAULT_LABEL')

Plots a histogram of the sarray provided as input, and returns the resulting Plot object.

The function supports numeric SArrays with dtypes int or float.

Parameters:
sa : SArray

The data to get a histogram for. Must be numeric (int/float).

xlabel : str (optional)

The text label for the X axis. Defaults to “Values”.

ylabel : str (optional)

The text label for the Y axis. Defaults to “Count”.

title : str (optional)

The title of the plot. Defaults to LABEL_DEFAULT. If the value is LABEL_DEFAULT, the title will be “<xlabel> vs. <ylabel>”. If the value is None, the title will be omitted. Otherwise, the string passed in as the title will be used as the plot title.

Returns:
out : Plot

A :class: Plot object that is the histogram.

Examples

Make a histogram of an SArray.

>>> x = turicreate.SArray([1,2,3,4,5,1,1,1,1,2,2,3,2,3,1,1,1,4])
>>> hist = turicreate.visualization.histogram(x)