Azzera filtri
Azzera filtri

How to plot 6 similar lines to see more obviously?

3 visualizzazioni (ultimi 30 giorni)
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!

Risposta accettata

Walter Roberson
Walter Roberson il 15 Ott 2019
Use multiple subplots. Or plot the difference between the lines. Or zoom in, a lot.
  3 Commenti
Walter Roberson
Walter Roberson il 17 Ott 2019
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 il 17 Ott 2019
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(

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by