How to plot different matrices in a cell with different marker styles

7 ビュー (過去 30 日間)
Hilary Kada
Hilary Kada 2020 年 9 月 18 日
コメント済み: KSSV 2020 年 9 月 18 日
Hi! I currently have a 15x1 cell with a matrix inside each cell value. This matrix consists of two columns, time and pressure values. I've been plotting this cell on the same figure using cellfun:
figure(), hold on
>> cellfun(@(x) plot(x(:,1), x(:,2)), PressureCell_1)
This produces a plot that I have attached, called Layer_pressure_full_hPa.jpg
Instead of each plot being a different colour, i was hoping for each plot to have a different marker style with a more monochromatic colour scheme. Is there a way to make a unique linespec for each plot, save it and then apply it to other cell plots? I have to repeat this process with multiple other cells with different values so was hoping there was a way to do this without individually changing the format of each plot.
Ive also attached my pressure cell with values.
Any help would be great, plots have always been so confusing on Matlab. Thanks !

採用された回答

KSSV
KSSV 2020 年 9 月 18 日
S = {'-*r', '-ok','-dr','-.b'} ;
for i = 1:4
C{i} = rand(10,1) ;
end
% plot
figure
hold on
for i = 1:4
plot(C{i},S{i})
end
  4 件のコメント
Hilary Kada
Hilary Kada 2020 年 9 月 18 日
編集済み: Hilary Kada 2020 年 9 月 18 日
Sorry I'm not 100% following, is there a way so that in the following figure, instead of each different graph being a different colour they have a different marker?
KSSV
KSSV 2020 年 9 月 18 日
Yes man...run a loop..I gace you an example.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by