How to plot 6 similar lines to see more obviously?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
Many thanks!
0 comentarios
Respuesta aceptada
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
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
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(
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Performance en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!