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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by