How to make this plot?

4 ビュー (過去 30 日間)
BN
BN 2020 年 11 月 25 日
コメント済み: BN 2020 年 11 月 25 日
Dear all, I have a table namely DATA. I don't know how to have a plot like this in the below for it.
Any advice is highly appreciated.

採用された回答

Sibi
Sibi 2020 年 11 月 25 日
編集済み: Sibi 2020 年 11 月 25 日
d=DATA{:,1};D=DATA{:,2};
min_year=year(min(d));
max_year=year(max(d));
A=zeros(12,max_year-min_year+1);
for k=1:length(d)
m=month(d(k));y=year(d(k))-min_year+1;
A(12-m+1,y)=D(k);
end
in=[min_year:max_year];%% added
contourf(in,1:12,A)%% edited
map = [0.8 0.1 0.1
0.9 0.9 0.1
1 1 1
0 0.9 0.1
0.1 0.1 1];
colormap(map)
colorbar
you can change the color by changing values in map
  3 件のコメント
Sibi
Sibi 2020 年 11 月 25 日
編集済み: Sibi 2020 年 11 月 25 日
I have edited the code,try now.
For more details check xticks and xticklabels in documentation .
BN
BN 2020 年 11 月 25 日
Thank you so much again.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by