GEE中如何制作多线段图表?以气象数据中气温、风速和气压制作时序图表为例

简单的时间序列图表

我们首先使用时间序列制图函数 ui.Chart.image.series(),该函数允许您在单个位置从图像集合创建时间序列图。输入数据集的每个波段都会得到一个时间序列。我们以 TerraClimate 数据集为例,选择每月最高和最低温度带。生成的图表是折线图,可以使用 .setOptions() 方法进一步自定义。

以下是应用于默认时间序列图表的自定义选项:

lineWidth:设置线条粗细
pointSize:设置数据点的大小
title标题:设置图表标题
vAxis:设置 Y 轴选项。轴标签使用标题选项指定。
hAxis:设置 X 轴选项。使用 gridlines 选项指定网格线。使用 format 选项指定刻度线标签的日期格式。
series系列:设置每个单独时间序列的选项。系列计数从 0 开始。

函数

ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty)
Generates a Chart from an ImageCollection. Plots derived values of each band in a region across images. Usually a time series.

X-axis: Image, labeled by xProperty value.

Y-axis: Band value.

Series: Band names.

Returns a chart.

Arguments:
imageCollection (ImageCollection):
An ImageCollection with data to be included in the chart.

region (Feature|FeatureCollection|Geometry):
The region to reduce.

reducer (Reducer, optional):
Reducer that generates the values for the y-axis. Must return a single value. 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 image on the x-axis. Defaults to ‘system:time_start’.

Returns: ui.Chart

代码

// 选择一个点作为研究区
var geometry = ee.Geometry.Point([116.395, 39.711]);

// 使用气象数据
var terraclimate = ee.ImageCollection('IDAHO_EPSCOR/TERRACLIMATE');

// 选择制定的4个波段

var temp = terraclimate.select(['tmmx', 'tmmn','vpd','vs']);

// The pixel values have a scale factor of 0.1
//这里我们进行温度转换转化为摄氏度,同样的所选的其他波段也进行了缩放
var tempScaled = temp.map(function(image

猜你喜欢

转载自blog.csdn.net/qq_31988139/article/details/133112968