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.
wrong
correct

回答(1 个)

the cyclist
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 个评论
kimy
kimy 2021-11-3
Thanks. In fact, I need the solid line instead of points plot. I uploaded my data here. Like you said, the third variable could be the order of each line. I do not know how to solve it. But I think if I use Origin to plot the figure by spline or B-spline, it could be solved. However, I'd better to use the Matlab format.
the cyclist
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 CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by