Skip to main content
Version: Java (Groovy)

histPlot

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

Syntax

histPlot(seriesName, x, xmin, xmax, nbins)
histPlot(seriesName, x, nbins)
histPlot(seriesName, x, xmin, xmax, nbins)
histPlot(seriesName, t)
histPlot(seriesName, t, x, xmin, xmax, nbins)
histPlot(seriesName, t, x, nbins)
histPlot(seriesName, sds, x, xmin, xmax, nbins)
histPlot(seriesName, sds, x, nbins)

Parameters

ParameterTypeDescription
seriesNameString

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.

sdsSelectableDataSet

A selectable data set - e.g., OneClick filterable table.

nbinsint

The number of intervals to use in the chart.

xdouble[]

The data to be used for the X values.

xfloat[]

The data to be used for the X values.

xint[]

The data to be used for the X values.

xlong[]

The data to be used for the X values.

xshort[]

The data to be used for the X values.

xString

The name of a column in t or sds.

xList<T>

The data to be used for the X values.

x<T>[]

The data to be used for the X values.

xmindouble

The minimum X value in the range.

xmaxdouble

The maximum X value in the range.

Returns

A histogram.

Examples

The following example plots data from a Deephaven table.

source = newTable(
intCol("Values", 1, 2, 2, 3, 3, 3, 4, 4, 5)
)

result = histPlot("Histogram Values", source, "Values", 5)
.chartTitle("Histogram Of Values")
.show()

The following example plots data from an array.

source = [1, 2, 2, 3, 3, 3, 4, 4, 5] as int[]

result = histPlot("Histogram Values", source, 5)
.chartTitle("Histogram Of Values")
.show()