How to plot like the inserted picture?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello guys,
I want to plot like the picture below in matlab:
Is it possible in Matlab?
In X-Axis is the Frequency.
Every row is a node and the colours are the values of the results.
2 件のコメント
Daniel M
2019 年 10 月 23 日
Sure, you can use imagesc and then just play with the properties of the plot. In particular: YTick, YTickLabel, GridColor, GridAlpha, TickLength, YGrid, XMinorGrid, etc. etc. There are many to list. You can also manually add white lines if that's what you want.
採用された回答
Daniel M
2019 年 10 月 24 日
編集済み: Daniel M
2019 年 10 月 24 日
You need to first collect all your values for yticks and labels, then set them all at once. For example
nfiles = 10;
for a = 1:nfiles
ticks(a) = a; % or whatever the ytick is
labels{a} = sprintf('Label %d',a);
end
figure
imagesc(magic(nfiles))
ax = gca;
set(ax,'YTick',ticks,'YTickLabel',labels);
set(ax,'YDir','normal')
Here is how you would add white lines.
x = [0.5 10.5]; % or however big your xaxis is
linelocs = [ticks(1:end-1) + 0.5]';
hold on
plot(x,[linelocs, linelocs],'w-','LineWidth',2)
And you can find the properties for the x-axis tick (length, colour, etc.) in here
xax = get(ax,'XAxis');
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Log Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!