ui.Chart.image.byRegion
Generates a Chart from an image. Extracts and plots band values in one or more regions in the image, with each band in a separate series.
- X-axis = Region labeled by xProperty (default: 'system:index')
- Y-axis = Reducer output.
- Series = Band name.
Returns a chart.
Usage | Returns |
---|
ui.Chart.image.byRegion(image, regions, reducer, scale, xProperty) | ui.Chart |
Argument | Type | Details |
---|
image | Image | Image to extract band values from. |
regions | Feature|FeatureCollection|Geometry|List, 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. Defaults to ee.Reducer.mean(). |
scale | Number, optional | Scale to use with the reducer in meters. |
xProperty | String, optional | Property to be used as the label for each Region on the x-axis. Defaults to 'system:index'. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["Generates a chart that visualizes band values within specified regions of an image."],["Charts display band values on the y-axis, region labels on the x-axis, and separate series for each band."],["Users can customize the chart by defining regions, specifying a reducer for calculations, setting a scale, and choosing a property for x-axis labels."],["The default reducer is `ee.Reducer.mean()`, and the default x-axis property is `'system:index'`."],["The function returns a `ui.Chart` object."]]],["The core functionality involves creating a chart from an image by extracting and plotting band values from specified regions. Users define `image`, `regions`, `reducer`, `scale`, and `xProperty`. It extracts band values, uses the provided `reducer` to compute a single y-value per band, which are then plotted as separate series. `regions` are labeled on the x-axis, based on the provided `xProperty`. The chart plots the reduced values per band in different regions, returning a `ui.Chart` object.\n"]]