Line colour code order with marker

10 ビュー (過去 30 日間)
Shrutidat
Shrutidat 2022 年 10 月 13 日
回答済み: KSSV 2022 年 10 月 13 日
[num,raw,txt] = xlsread (' filelocation.xlsx');
hold all
sheets = 1:10;
for I = numel(sheets)
A = xlsread('.............xlsx', num2str(sheets(I)), 'A10:A35');
B = xlsread('.............xlsx', num2str(sheets(I)), 'B10:B35');
C = xlsread('.............xlsx', num2str(sheets(I)), 'C10:C35');
D = xlsread('.............xlsx', num2str(sheets(I)), 'D10:D35');
hold on
subplot (1,3,1)
plot( A(I), B(I) ) % plot A vs B from all 10 sheets , how to specify specific colour and marker ?
hold on
subplot (1,3,2)
plot( A(I), C(I) )
hold on
subplot (1,3,3)
plot( A(I), D(I) )
end
I want plot to be like this
1-5 sheets line has to be 'red','blue','green','cyan','black' with all solid line
followed by 6-10 sheets line to be followed by same specified colours with dotted line. How to specify this in subplot while plotting?

採用された回答

KSSV
KSSV 2022 年 10 月 13 日
Note that xlsread is obselte. You can use readtable.
A = rand(5,10) ;
C = {'r','b','g','-.c','-dm'} ; % specify your colors and markers like this
figure
hold on
for i = 1:5
plot(A(i,:),C{i})
end

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by