Plotting weather graphs so subsequent years are superimposed rather than sequential

1 回表示 (過去 30 日間)
Wendy Cameron
Wendy Cameron 2019 年 2 月 5 日
回答済み: KSSV 2019 年 2 月 5 日
I have many years of weather data to plot. At present the data is all in one long column. But I don't want the graph to be one long graph, I want each different year of data to be superimposed on the same axis so I can make comparisons from year to year.
Some sample data is attached.
Much appreciated.
Wendy

回答 (1 件)

KSSV
KSSV 2019 年 2 月 5 日
T = readtable('Matlab graph question.xlsx') ;
theyears = year(T.(1)) ;
[c,ia,ib] = unique(theyears) ;
c(isnan(c)) = [] ;
% plot 2018 year data
idx = theyears==2018 ;
plot(T.(1)(idx),T.(2)(idx))

カテゴリ

Help Center および File ExchangeNetworks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by