Skip to main content
Version: Python

catHistPlot

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

Syntax

plot_cat_hist(series_name, t, category)
plot_cat_hist(series_name, category)

Parameters

ParameterTypeDescription
series_nameString

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

ttable

The table that holds the data to be plotted.

categoryString

The name of the column containing the discrete values.

categorylist

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])
])

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