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


    介绍

    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 
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
  • 相关阅读:
    【MySQL高级】MySQL的存储引擎
    gpg: keyserver receive failed: Cannot assign requested address
    科普:什么是权益证明?
    typescript76-在react中使用ts语法
    2.1.1 摄像头
    设计模式 --- 工厂模式
    深度KWeaver:价值驱动,认知智能走向开源共创
    python yield用法
    SpringBoot“互联网+”居家养老服务平台微信小程序的设计与实现源码
    网络安全—自学笔记
  • 原文地址:https://blog.csdn.net/qq_31988139/article/details/133113535