필터 지우기
필터 지우기

How to plot 6 similar lines to see more obviously?

조회 수: 3 (최근 30일)
Phung Minh
Phung Minh 2019년 10월 15일
댓글: Walter Roberson 2019년 10월 17일
Hi everyone,
I have a trouble with plotting 6 similar lines in one figure. But the data are so close to one another? How to solve this?
untitled.jpg
Many thanks!

채택된 답변

Walter Roberson
Walter Roberson 2019년 10월 15일
Use multiple subplots. Or plot the difference between the lines. Or zoom in, a lot.
  댓글 수: 3
Walter Roberson
Walter Roberson 2019년 10월 17일
figure
base = B(:,1);
plot(A,B(:,2)-base,'-b','LineWidth',1.5)
hold on
plot(A,B(:,3)-base,'-k','LineWidth',1.5)
plot(A,B(:,4)-base,'--r','LineWidth',1.5)
plot(A,B(:,5)-base,'--b','LineWidth',1.5)
plot(A,B(:,6)-base,'--k','LineWidth',1.5)
hold off
set(gca,...
'Units','normalized',...
'FontUnits','points',...
'FontWeight','bold',...
'FontSize',14, ...
'FontName','Times')
% ylabel('Thickness(m)','Fontsize',14, 'FontName','times')
% xlabel('Stress distribution (N/m^2)','Fontsize',14, 'FontName','times')
legend('SS1.2-SS1.1','SS1.3-SS1.1','SS1.4-SS1.1','SS1.5-SS1.1','SS1.6-SS1.1')
xlabel('Time (s)')
ylabel('Pressure (bar)')
% set(gca,'yscale','log')
% xlim([100 500]);
grid on
Walter Roberson
Walter Roberson 2019년 10월 17일
Or you might prefer
figure
base = mean(B,2);
plot(A,B(:,1)-base,'-r','LineWidth',1.5)
hold on
plot(A,B(:,2)-base,'-b','LineWidth',1.5)
plot(A,B(:,3)-base,'-k','LineWidth',1.5)
plot(A,B(:,4)-base,'--r','LineWidth',1.5)
plot(A,B(:,5)-base,'--b','LineWidth',1.5)
plot(A,B(:,6)-base,'--k','LineWidth',1.5)
hold off
set(gca,...
'Units','normalized',...
'FontUnits','points',...
'FontWeight','bold',...
'FontSize',14, ...
'FontName','Times')
% ylabel('Thickness(m)','Fontsize',14, 'FontName','times')
% xlabel('Stress distribution (N/m^2)','Fontsize',14, 'FontName','times')
legend('SS1.1-mean','SS1.2-mean','SS1.3-mean','SS1.4-mean','SS1.5-mean','SS1.6-mean')
xlabel('Time (s)')
ylabel('Pressure (bar)')
% set(

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Gaussian Process Regression에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by