How can I plot my reflectance data according the "day of year"?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Meghraj Kc
am 17 Jun. 2022
Beantwortet: Cris LaPierre
am 17 Jun. 2022
I have the reflectance data from 2013 (January- Decemeber) to 2022 (January- Decemeber). I want to plot my reflectance data on the basis of "day of year" such that my x-axis should be 0 to 365 day and y-axis should be refletance data.
I have attached the excel file that contains reflectance data for seven different band. I want to plot each band with day of year.
1 Kommentar
Cris LaPierre
am 17 Jun. 2022
There are 129 rows of data. What is your sample frequency? You say you have 10 years of data (Jan 2013 - Dec 2022), so it appears to be roughly 1x per month. However, we are only in June of 2022, so you must not have data through December of 2022 yet.
Akzeptierte Antwort
Cris LaPierre
am 17 Jun. 2022
Here's a first attempt. I will create a datetime vector of evenly spaced time values from 1/1/2013 - 12/31/2022. From there, I can use the day function to get 'dayofyear', and then use gscatter to plot each year of data by day of year on the same axes.
data = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1036075/Mean_Surface_REF.xlsx')
sDate = datetime(2013,1,1);
eDate = datetime(2022,12,31);
time = linspace(sDate,eDate,length(data))';
doy = day(time,"dayofyear");
gscatter(doy,data,year(time))
2 Kommentare
Weitere Antworten (1)
Cris LaPierre
am 17 Jun. 2022
Use the following syntax:
You cannot skip an input, so if you want to use the default color and symbol, your syntax might look like this
gscatter(doy,data,year(time),[],[],12)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!