When using scatter, how can I delete all the repeated values except the minimum for each x value?
1 view (last 30 days)
Show older comments
Lance Noel
on 17 Jun 2015
Commented: Lance Noel
on 18 Jun 2015
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 Comments
Accepted Answer
Walter Roberson
on 18 Jun 2015
[ux, iax, icx] = unique(x);
min_at_x = accumarray(icx, y, [], @min);
scatter(ux, min_at_x);
2 Comments
More Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!