Borrar filtros
Borrar filtros

How to plot 6 similar lines to see more obviously?

3 visualizaciones (últimos 30 días)
Phung Minh
Phung Minh el 15 de Oct. de 2019
Comentada: Walter Roberson el 17 de Oct. de 2019
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!

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by