How to avoid the mistake plot if one x value corresponding to two or more y values?
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear all,
I am ploting the figures but there is a problem that I am encountering. I don't know how to solve it. Hope anyone can give me some tips. Appreciate.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/788690/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/788695/image.jpeg)
댓글 수: 0
답변 (1개)
the cyclist
2021년 11월 3일
If the density of your points is high enough, you could consider plotting only the markers, and not the connecting lines, e.g.
plot(x,y,'.')
If that doesn't work, do you have a third variable that indicates the proper order to connect the points? If so, then sort x and y by that variable. If not, I don't know how one could know which points to connect.
댓글 수: 2
the cyclist
2021년 11월 3일
I don't understand what you mean by "the third variable could be the order of each line". Do you mean your variable VarName3? Can you infer the variable ordering from it?
참고 항목
카테고리
Help Center 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!