Stay organized with collections Save and categorize content based on your preferences.

Generates a Chart from an image. Plots derived band values in classified regions in an image.

  - X-axis = Band name (all bands except the class band are charted).

  - Y-axis = Band value.

  - Series = Class label.

Returns a chart.

ui.Chart.image.byClass(image, classBand, region, reducer, scale, classLabels, xLabels)ui.Chart
imageImageClassified image to derive band values from.
classBandNumber|StringThe class label band in this image.
regionFeature|FeatureCollection|Geometry, optionalThe region to reduce. If omitted, uses the entire image.
reducerReducer, optionalReducer that generates the value(s) for the y-axis. Must return a single value per band. Defaults to ee.Reducer.mean().
scaleNumber, optionalScale to use with the reducer in meters.
classLabelsList., optionalA dictionary of labels used to identify classes in the series legend. If omitted, classes will be labeled with the value of classBand.
xLabelsList, optionalA list of labels used to label bands on the xAxis. Must have one fewer elements than the number of image bands. If omitted, bands will be labeled with their names. If the labels are numeric (e.g. wavelengths), x-axis will be continuous.