필터 지우기
필터 지우기

2d plot problem

조회 수: 1 (최근 30일)
student_md
student_md 2021년 3월 8일
댓글: student_md 2021년 3월 9일
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.

답변 (1개)

Walter Roberson
Walter Roberson 2021년 3월 8일
You need to use separate plots (at least for third). The disadvantage is that it becomes more difficult to track relative values.
  댓글 수: 1
student_md
student_md 2021년 3월 9일
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?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by