gap in the plot
이전 댓글 표시

How can I make the red plot start in the same place (from 1)?
답변 (1개)
Walter Roberson
2019년 10월 31일
red_x = red_x - min(red_x) + 1;
plot(blue_x, blue_y, 'b', red_x, red_y, 'r')
댓글 수: 6
Valeria Pinus
2019년 10월 31일
Walter Roberson
2019년 10월 31일
Yes, that is to be expected. You did not specify that was not to happen.
It looks to me as if whatever process generated the data for the red line did not start from the same position. However, you have not given us any information about how the red line was generated, so we can only make wild guesses.
Valeria Pinus
2019년 10월 31일
Walter Roberson
2019년 10월 31일
Perhaps
xi_new(i)=min(X)+dx*i;
should be
xi_new(i)=min(X)+dx*(i-1);
?
Valeria Pinus
2019년 10월 31일
Walter Roberson
2019년 10월 31일
I see.
Your processing requires a gap. In form2 you have
i=max(find(X<z));
which would be empty if z is exatly equal to the first X because you are attempting to process right to the left margin.
You can reduce the width of the gap by reducing dx, but you cannot eliminate the gap.
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
