When using scatter, how can I delete all the repeated values except the minimum for each x value?
1 次查看(过去 30 天)
显示 更早的评论
I am plotting data that has more than one y value for every x value. I'm using scatter(x,y) to plot this, but I want to only show the minimum of each x value. Both x and y are 14641 x 1 vectors. Any suggestions?
0 个评论
采纳的回答
Walter Roberson
2015-6-18
[ux, iax, icx] = unique(x);
min_at_x = accumarray(icx, y, [], @min);
scatter(ux, min_at_x);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!