I'm trying to plot a chart and get data from Google Earth Engine. I'm using MODIS-Aqua/L3SMI data in Earth Engine.
I have used Earth Engines in built functions to compare average sea surface temperatures by day of year per year. However, it's pretty busy and would like to calculate an average per month then plot the different years of the data set. Using the code here I've been able to get an average per month over all years in the data set.
var sst = ee.ImageCollection('NASA/OCEANDATA/MODIS-Aqua/L3SMI').select('sst').filterDate(ee.Date('2013-01-01'), ee.Date('2017-12-31'))
var byMonth = ee.ImageCollection.fromImages(
months.map(function (m) {
return sst.filter(ee.Filter.calendarRange(m, m, 'month'))
.select(0).mean()
.set('month', m);
}));
Is there a way of altering this code so it can be averages by month per year and plotted? SO you get different lines on the plot per year which can be used as a visual comparison?