公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.Chart.image.byClass
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
根据图片生成图表。在图像的分类区域中绘制派生波段值。
- X 轴 = 频段名称(图表中显示了除类别频段之外的所有频段)。
- Y 轴 = 频段值。
- Series = 类标签。
返回图表。
用法 | 返回 |
---|
ui.Chart.image.byClass(image, classBand, region, reducer, scale, classLabels, xLabels) | ui.Chart |
参数 | 类型 | 详细信息 |
---|
image | 图片 | 用于推导波段值的分类图像。 |
classBand | Number|String | 相应图片中的类标签频段。 |
region | Feature|FeatureCollection|Geometry,可选 | 要缩减的区域。如果省略,则使用整个图片。 |
reducer | Reducer,可选 | 用于生成 y 轴值的 reducer。必须为每个波段返回一个值。默认值为 ee.Reducer.mean()。 |
scale | 数字,可选 | 用于与缩减器搭配使用的缩放比例(以米为单位)。 |
classLabels | List.<String>|List<String>|Object,可选 | 用于标识序列图例中各个类的标签的字典。如果省略,系统将使用 classBand 的值标记类别。 |
xLabels | List<Object>,可选 | 用于标记 x 轴上区间的标签列表。必须比图片波段数少一个元素。如果省略,频段将使用其名称进行标记。如果标签是数值(例如波长),则 x 轴将是连续的。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThe \u003ccode\u003eui.Chart.image.byClass\u003c/code\u003e function generates a chart that visualizes band values within classified regions of an image, plotting band values on the y-axis and band names on the x-axis, with separate series for each class label.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify the input image, the band containing class labels, an optional region of interest, a reducer for calculating band values (defaulting to the mean), a scale for the reducer, custom labels for classes, and custom labels for bands.\u003c/p\u003e\n"],["\u003cp\u003eThe chart provides insights into how band values vary across different classes within the image, allowing for analysis of spectral characteristics associated with each class.\u003c/p\u003e\n"]]],[],null,["# ui.Chart.image.byClass\n\n\u003cbr /\u003e\n\nGenerates a Chart from an image. Plots derived band values in classified regions in an image.\n\n\u003cbr /\u003e\n\n- X-axis = Band name (all bands except the class band are charted).\n\n- Y-axis = Band value.\n\n- Series = Class label.\n\nReturns a chart.\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------------------------------------|----------|\n| `ui.Chart.image.byClass(image, classBand, `*region* `, `*reducer* `, `*scale* `, `*classLabels* `, `*xLabels*`)` | ui.Chart |\n\n| Argument | Type | Details |\n|---------------|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `image` | Image | Classified image to derive band values from. |\n| `classBand` | Number\\|String | The class label band in this image. |\n| `region` | Feature\\|FeatureCollection\\|Geometry, optional | The region to reduce. If omitted, uses the entire image. |\n| `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(). |\n| `scale` | Number, optional | Scale to use with the reducer in meters. |\n| `classLabels` | List.\\\u003cString\\\u003e\\|List\\\u003cString\\\u003e\\|Object, optional | A dictionary of labels used to identify classes in the series legend. If omitted, classes will be labeled with the value of classBand. |\n| `xLabels` | List\\\u003cObject\\\u003e, optional | A 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. |"]]