GEE图表——趋势线图表的加载和展示包含纵坐标间隔的设定(以某区域年均降水总量为例)

这篇博客介绍了如何使用Google Earth Engine(GEE)图表来展示某个地区年均降水总量的时间序列,并设置趋势线以分析降水量的变化趋势。文章详细讲解了如何应用`vAxis.ticks`来设定Y轴刻度,调整`gridlines.color`和`gridlines.legend`以定制图表样式,以及通过`trendlines`配置趋势线的显示。通过`ui.Chart.image.series`函数处理ImageCollection数据,实现了时间序列图表的生成。
摘要由CSDN通过智能技术生成

介绍

Google 图表可以动态计算并在图表上显示趋势线。您可以选择线性、多项式或指数趋势线。线性趋势线对数据集进行最小二乘回归模型拟合。在这里,我们利用降水数据的时间序列,将其汇总为年降水量,然后显示一条线性趋势线,以显示该地区的降水量是在增加还是在减少。

下面是应用于时间序列图表的样式选项:

vAxis.ticks:设置 Y 轴的刻度位置。我们可以手动指定所需的准确刻度线。
gridlines.color:设置网格线的颜色。
gridlines.legend:图例:设置图例的位置。in 选项使图例显示在图表内部。
series.visibleInLegend:设置图例中是否可见特定系列标签。
trendlines.趋势线设置趋势线选项。我们使用 labelInLegend 选项覆盖默认标签。

这里的关键就是对trendlines这个函数中字典属性的设定。

函数

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 chirps = ee.ImageCollection('UCSB-CHG/CHIRPS/PENTAD');

// 计算年总的降水趋势,这里以年为单位
var createAnnualImage = function(year) {
   
  var startDate 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

此星光明

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值