필터 지우기
필터 지우기

How can I plot my reflectance data according the "day of year"?

조회 수: 1 (최근 30일)
Meghraj Kc
Meghraj Kc 2022년 6월 17일
답변: Cris LaPierre 2022년 6월 17일
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
Cris LaPierre
Cris LaPierre 2022년 6월 17일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Cris LaPierre
Cris LaPierre 2022년 6월 17일
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')
data = 129×7
-0.0011 0.0037 0.0191 0.0088 -0.0011 0.0022 0.0029 0.0010 0.0056 0.0179 0.0100 -0.0007 0.0027 0.0034 0.0027 0.0084 0.0222 0.0131 0.0039 0.0086 0.0091 -0.0026 0.0017 0.0132 0.0056 -0.0022 0.0027 0.0036 0.0001 0.0061 0.0183 0.0140 0.0095 0.0162 0.0165 0.0063 0.0073 0.0128 0.0064 -0.0009 0.0007 0.0011 0.0056 0.0074 0.0149 0.0075 -0.0010 0.0008 0.0012 0.0008 0.0062 0.0153 0.0141 0.0105 0.0101 0.0095 0.0052 0.0090 0.0185 0.0118 0.0017 0.0055 0.0059 0.0069 0.0084 0.0146 0.0072 -0.0022 0.0001 0.0005
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
Meghraj Kc
Meghraj Kc 2022년 6월 17일
Thank you for this help and guidence
Meghraj Kc
Meghraj Kc 2022년 6월 17일
I want to increase the size of marker, How can I do this ? I am geeting error while increasing the size of marker.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Cris LaPierre
Cris LaPierre 2022년 6월 17일
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)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by