Skip to main content
Version: Java (Groovy)

plotBy

The plotBy method creates muliptle XY series plots per distinct grouping value specified in byColumns.

Syntax

plotBy(seriesName, t, x, y, byColumns)
plotBy(seriesName, sds, x, y, byColumns)

Parameters

ParameterTypeDescription
seriesNameComparable

The name you want to use to identify the series on the plot itself.

tTable

The table.

sdsSelectableDataSet

Selectable data set (e.g., OneClick filterable table).

xString

The column in t contains the X variable data.

yString

The column in t that contains the Y variable data.

byColumnslist[String]

Column(s) in t that holds the grouping data.

Returns

An XY series plot with multiple series.

Examples

The following example plots data from a Deephaven table.

import static io.deephaven.csv.CsvTools.readCsv

source = readCsv("https://media.githubusercontent.com/media/deephaven/examples/main/CryptoCurrencyHistory/CSV/CryptoTrades_20210922.csv")

result = plotBy("Sept22", source, "Timestamp", "Price", "Instrument").show()

img