To create 10 SubPlots generated during for loop with different colours

조회 수: 1 (최근 30일)
Priya
Priya 2013년 8월 20일
I have written following code to make 10 line graphs in same plot.
How can I modify this to make individual 10 subplots within same plot screen without overlapping each other ?
What is the trick behind diving the screen into equal parts (eg: 10 here) ?
%%%%%%% CODE STARTS HERE %%%%%%%
pre_list = dir('*.mat');
file_list = {pre_list.name}';
C = {'c'; 'm'; 'y'; 'k'; 'r'; 'g'; 'b'; [.5 .6 .7];[.8 .2 .6];[.1 .2 .3]};
% C = 10 loops for ten plots with different colours %
for i = 1:size(file_list,1)
load(file_list{i,1})
variable_wise = cell(zeros); a = 1;
for j = 1:size(integrated_data,1)
if strcmp (integrated_data{j,3},'Ln Kf-m - Ln Kf-w')
variable_wise(a,1) = integrated_data(j,2);
variable_wise(a,2) = integrated_data(j,5);
a = a+1;
end
end
a = cell2mat(variable_wise(:,2));
plot(a,'color',C{i,1},'LineWidth',2);
hold on
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by