AI-generated Key Takeaways
-
The
ui.Chart.image.regionsfunction generates a chart by extracting and plotting the value of each band within specified regions from an image. -
The chart's x-axis represents bands, the y-axis displays the reducer output, and series represent regions.
-
Key arguments include the input
image, optionalregions,reducer,scale,seriesPropertyfor labeling regions, andxLabelsfor band labels.
- X-axis = Band labeled by xProperty (default: band name).
- Y-axis = Reducer output.
- Series = Region labeled by seriesProperty (default: 'system:index').
Returns a chart.
| Usage | Returns |
|---|---|
ui.Chart.image.regions(image, regions, reducer, scale, seriesProperty, xLabels) | ui.Chart |
| Argument | Type | Details |
|---|---|---|
image | Image | Image to extract band values from. |
regions | Feature|FeatureCollection|Geometry|List<Feature>|List<Geometry>, optional | Regions to reduce. Defaults to the image's footprint. |
reducer | Reducer, optional | Reducer that generates the value(s) for the y-axis. Must return a single value per band. |
scale | Number, optional | The pixel scale in meters. |
seriesProperty | String, optional | Property to be used as the label for each region in the legend. Defaults to 'system:index'. |
xLabels | List<Object>, optional | A list of labels used for bands on the x-axis. Must have the same number of elements as the image bands. If omitted, bands will be labeled with their names. If the labels are numeric (e.g. wavelengths), x-axis will be continuous. |