Skip to main content
Version: Python

plot_cat_hist

The plot_cat_hist method creates category histograms using data from Deephaven tables or arrays.

Syntax

plot_cat_hist(
series_name: str,
t: Union[Table, SelectableDataSet],
category: Union[str, list[str], list[int], list[float]]
) -> Figure

Parameters

ParameterTypeDescription
series_namestr

The name (as a String) you want to use to identify the series on the plot itself.

tUnion[Table, SelectableDataSet]

The table (or other selectable data set) that holds the data to be plotted.

categoryUnion[str, list[str], list[int], list[float]]

The list containing the discrete values.

Returns

A category histogram plot.

Examples

The following example plots data from a Deephaven table.

from deephaven.plot.figure import Figure
from deephaven.column import int_col
from deephaven import new_table

source = new_table([int_col("Keys", [3, 2, 2, 1, 1, 1])])

new_plot = (
Figure()
.plot_cat_hist(series_name="Keys count", t=source, category="Keys")
.chart_title(title="Count of Each Key")
.show()
)