2d plot problem

2 vues (au cours des 30 derniers jours)
student_md
student_md le 8 Mar 2021
Commenté : student_md le 9 Mar 2021
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.

Réponses (1)

Walter Roberson
Walter Roberson le 8 Mar 2021
You need to use separate plots (at least for third). The disadvantage is that it becomes more difficult to track relative values.
  1 commentaire
student_md
student_md le 9 Mar 2021
Thanks for your interest.
May be nested figures can be good for me.
1st Option: We can embed the 1st picture in the question into the 2nd picture in the main question.
2nd Option: We can embed the just overflowing part of 1st picture into the 2nd picture in the main question.
Or another suggestion for embed pictures?
Could you help me pls. for doingt it?

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by