2d plot problem
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have imported from four excel files. (Please find attached files) I have plotted the datas in them as follows:
clear all;
W1=readtable('first.xlsx');
D1=table2array(W1);
y1 = D1(2:end,2);
x1=D1(1,2:end).';
%%%%%%%%%%%
W2=readtable('second.xlsx');
D2=table2array(W2);
y2 = D2(2:end,2);
x2=D2(1,2:end);
%%%%%%%%%%%
W3=readtable('third.xlsx');
D3=table2array(W3);
y3 = D3(2:end,2);
x3=D3(1,2:end).';
%%%%%%%%%%%
W4=readtable('forth.xlsx');
D4=table2array(W4);
y4 = D4(2:end,2);
x4=D4(1,2:end).';
%%%%%
figure (1);
p1=plot(x1,y1,"Marker","o","MarkerEdgeColor","none", "MarkerFaceColor","r","DisplayName","first");
xlabel('x') ;
ylabel('Error');
hold on;
p2=plot(x2,y2,"Marker","s","MarkerEdgeColor","none", "MarkerFaceColor","b","DisplayName","second");
hold on;
p3=plot(x3,y3,"Marker","v","MarkerEdgeColor","none", "MarkerFaceColor","m","DisplayName","third");
hold on;
p4=plot(x4,y4,"Marker","^","MarkerEdgeColor","none", "MarkerFaceColor","c","DisplayName","fourth");
legend([p4,p3,p2,p1],"Location","north")
After running the code, I get the following figure: (In the figure, some lines is very close to the line y=0)
Then I added the following code
ylim([10^(-5) 10^(-3)])
I get the following picture. (But now the some part doesn' appear in the plot)
How do we make the graphic visible and understandable? Nested plots or another solutions?
I am looking forward to your helps.
Any help would be appreciated.
0 comentarios
Respuestas (1)
Walter Roberson
el 8 de Mzo. de 2021
You need to use separate plots (at least for third). The disadvantage is that it becomes more difficult to track relative values.
Ver también
Categorías
Más información sobre Subplots 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!