i am new to matlab & i am stuck at colouring muliple lines in a single graph. The code is as below
1 次查看(过去 30 天)
显示 更早的评论
close all
sr='EVF EXPERIMENTAL DATA.xlsx';
% eps_dot=0.1
data_1=xlsread(sr,'EVF P-LLDPE','C2:C1158');
data_2=xlsread(sr,'EVF P-LLDPE','D2:D1158');
% eps_dot=0.3
data_3=xlsread(sr,'EVF P-LLDPE','E2:E900');
data_4=xlsread(sr,'EVF P-LLDPE','F2:F900');
% eps_dot=1
data_5=xlsread(sr,'EVF P-LLDPE','G2:G360');
data_6=xlsread(sr,'EVF P-LLDPE','H2:H360');
% eps_dot=3
data_7=xlsread(sr,'EVF P-LLDPE','I2:I101');
data_8=xlsread(sr,'EVF P-LLDPE','J2:J101');
% eps_dot=10
data_9 =xlsread(sr,'EVF P-LLDPE','K2:K35');
data_10=xlsread(sr,'EVF P-LLDPE','L2:L35');
data='VIRGIN LLDPE.xlsx';
% eps_dot=0.1
data_11=xlsread(data,'Sheet1','A4:A543');
data_22=xlsread(data,'Sheet1','B4:B543');
% eps_dot=0.3
data_33=xlsread(data,'Sheet1','C4:C650');
data_44=xlsread(data,'Sheet1','D4:D650');
% eps_dot=1
data_55=xlsread(data,'Sheet1','E4:E306');
data_66=xlsread(data,'Sheet1','F4:F306');
% eps_dot=3
data_77=xlsread(data,'Sheet1','G4:G107');
data_88=xlsread(data,'Sheet1','H4:H107');
% eps_dot=10
data_99 =xlsread(data,'Sheet1','I4:I17');
data_1010=xlsread(data,'Sheet1','J4:J17');
colorstring1 = 'kbgry';
loglog(data_1,data_2,data_3,data_4,data_5,data_6,data_7,data_8,data_9,data_10,'color', colorstring(1), 'linewidth', 1.5);
hold on
loglog(data_11,data_22,data_33,data_44,data_55,data_66,data_77,data_88,data_99,data_1010, '*', 'color', colorstring(1));
grid on
xlabel('Time (sec)');
ylabel('Extensional Viscosity (Pa-sec)');
0 个评论
回答(1 个)
bon sai
2018-1-25
Please try to manage line color in axes instead.
loglog(data_1,data_2,data_3,data_4,data_5,data_6,data_7,data_8,data_9,data_10, 'linewidth', 1.5);
hold on
loglog(data_11,data_22,data_33,data_44,data_55,data_66,data_77,data_88,data_99,data_1010, '*');
grid on
xlabel('Time (sec)');
ylabel('Extensional Viscosity (Pa-sec)');
% get current axes
axes1 = gca;
% now add color code
axes1.ColorOrder = [1 1 1;0 0 1;0 0 1;1 0 0;1 1 0];
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!