2

I am harmonizing Landsat 8 and Sentinel-2 datasets for agricultural mapping purposes. When plotting the results using ui.Chart.image.series function, one graph shows the y-axis starting not at 0. For comparison purposes I need the y-axis on the charts to start at zero. How to adjust the below command to force y-axis to start at zero?

// Plot the fitted model and the original data at the ROI.
print(ui.Chart.image.series(fittedHarmonicboth.select(['fitted','NDVI']), roi, ee.Reducer.mean(), 10)
    .setOptions({
      title: 'Harmonic model: both S2 and L8 values',
      lineWidth: 1,
      pointSize: 3,
}));

1 Answer 1

1

Within your options you should add the vAxis.minValue, such as:

print(ui.Chart.image.series(fittedHarmonicboth.select(['fitted','NDVI']), roi, ee.Reducer.mean(), 10)
    .setOptions({
      title: 'Harmonic model: both S2 and L8 values',
      lineWidth: 1,
      pointSize: 3,
      vAxis: {minValue:0},
}));

More options are shown here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.