Google Earth Engine(GEE)——矢量柱状图和组图

简介: Google Earth Engine(GEE)——矢量柱状图和组图


ui.Chart.feature.histogram

ui.Chart.feature.histogram(features, property, maxBuckets, minBucketWidth, maxRaw)

Generates a Chart from a set of features. Computes and plots a histogram of the given property.

- X-axis = Histogram buckets (of property value).

- Y-axis = Frequency (i.e. the number of features whose value of property lands within the x-axis bucket bounds).

Returns a chart.


Arguments:

features (Feature|FeatureCollection|List<Feature>):

The features to include in the chart.

property (String):

The name of the property to generate the histogram for.

maxBuckets (Number, optional):

The maximum number of buckets to use when building a histogram; will be rounded up to a power of 2. Not used when the value of property is non-numeric.

minBucketWidth (Number, optional):

The minimum histogram bucket width, or null to allow any power of 2. Not used when property is non-numeric.

maxRaw (Number, optional):

The number of values to accumulate before building the initial histogram. Not used when property is non-numeric.


Returns: ui.Chart

x 轴由选定属性值范围的值箱定义;y 轴是给定 bin 中的元素数。

 

// 加载 PRISM 气候法线图像集合;将图像转换为波段。
var normClim = ee.ImageCollection('OREGONSTATE/PRISM/Norm81m').toBands();
// 为美国西部的一个地区制作气候变量的点样本。
var region = ee.Geometry.Rectangle(-123.41, 40.43, -116.38, 45.14);
var climSamp = normClim.sample(region, 5000);
// 定义图表并将其打印到控制台。
var chart =
    ui.Chart.feature//这里柱状图的函数是直接应用的
        .histogram({features: climSamp, property: '07_ppt', maxBuckets: 30})
        .setOptions({
          title: 'July Precipitation Distribution for NW USA',
          hAxis: {
            title: 'Precipitation (mm)',
            titleTextStyle: {italic: false, bold: true}
          },
          vAxis: {
            title: 'Pixel count',
            titleTextStyle: {italic: false, bold: true}
          },
          colors: ['1d6b99'],
          legend: {position: 'none'}
        });
print(chart);

ui.Chart.feature.groups

ui.Chart.feature.groups(features, xProperty, yProperty, seriesProperty)

从一组特征生成图表。绘制跨要素组的给定属性的值。具有相同 groupProperty 值的要素将被分组并绘制为单个系列。

Generates a Chart from a set of features. Plots the value of a given property across groups of features. Features with the same value of groupProperty will be grouped and plotted as a single series.

- X-axis = xProperty values.

- Y-axis = yProperty values.

- Series = Feature groups, by seriesProperty.

Returns a chart.


Arguments:

features (Feature|FeatureCollection|List<Feature>):

The features to include in the chart.

xProperty (String):

Property to be used as the label for each feature on the x-axis.

yProperty (String):

Property to be plotted on the y-axis.

seriesProperty (String):

Property used to determine feature groups. Features with the same value of groupProperty will be plotted as a single series on the chart.


Returns: ui.Chart

特征沿 x 轴绘制,由选定属性的值标记。系列由给定属性的唯一值集定义的列表示。Y 轴位置由给定属性的值定义。通过将图表类型设置为'ScatterChart'( .setChartType('ScatterChart')),可以将此图更改为散点图 。或者,如果时间为x轴的变量,你可能更愿意使用一个折线图: .setChartType('LineChart')

// 导入案例数据资料
var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example');
// 设置图标
var chart =
    ui.Chart.feature
        .groups({设置组内的信息,
          features: ecoregions,
          xProperty: 'label',
          yProperty: '01_tmean',
          seriesProperty: 'warm'
        })
        .setSeriesNames(['Warm', 'Cold'])
        .setChartType('ColumnChart')
        .setOptions({
          title: 'Average January Temperature by Ecoregion',
          hAxis:
              {title: 'Ecoregion', titleTextStyle: {italic: false, bold: true}},
          vAxis: {
            title: 'Jan temp (°C)',
            titleTextStyle: {italic: false, bold: true}
          },
          bar: {groupWidth: '80%'},
          colors: ['cf513e', '1d6b99'],
          isStacked: true
        });
print(chart);



相关文章
|
4月前
|
数据可视化 定位技术 Sentinel
如何用Google Earth Engine快速、大量下载遥感影像数据?
【2月更文挑战第9天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,批量下载指定时间范围、空间范围的遥感影像数据(包括Landsat、Sentinel等)的方法~
1942 1
如何用Google Earth Engine快速、大量下载遥感影像数据?
|
4月前
|
机器学习/深度学习 算法 数据可视化
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
193 0
|
4月前
|
存储 编解码 数据可视化
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
【2月更文挑战第14天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,按照给定的地表分类数据,对每一种不同的地物类型,分别加以全球范围内随机抽样点自动批量选取的方法~
424 1
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
|
4月前
|
API Go 网络架构
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
241 4
|
4月前
|
机器学习/深度学习 存储 人工智能
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
202 3
|
4月前
|
编解码 人工智能 算法
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
71 0
|
4月前
|
编解码 人工智能 数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
100 0
|
4月前
|
编解码
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
59 0
|
4月前
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
174 0
|
4月前
|
传感器 编解码 数据处理
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
88 0

热门文章

最新文章