Connecting the Dots for a Scatter Plot
14 次查看(过去 30 天)
显示 更早的评论
Hey everyone. I need to draw a line through a scatter plot. The vector array that I'm giving the scatter function is not in order though (so, there isn't any connection between say VectorItem(1,:) and VectorItem(2,:). Basically I want to turn this image into the following image
Thanks!
0 个评论
回答(3 个)
Shashank Prasanna
2013-5-3
There is not enough information in just the two vectors to draw that line. There seems to be some other detail that is missing, such as on what criterion do you decide to exclude the island on the top right. If you are aware of any other information or what generated your existing image that would be helpful.
If you want a function that computes an enclosure then you could try convex hull:
1 个评论
Walter Roberson
2013-5-3
If you wrote the dots into a data matrix, and then did an imdilate() followed by thinning the image, and then labeled the image -- then you could ask for the regionprops for the boundary pixel list of each region.
There might well be a better way. There probably is.
0 个评论
Image Analyst
2013-5-3
I already gave you the code for a "concave hull" (or "restricted convex hull") ( http://grasswiki.osgeo.org/wiki/Create_concave_hull in this link: http://www.mathworks.com/matlabcentral/answers/73617#comment_146191. That code creates a binary image. So once you have the binary image, you simply call bwboundaries() to get the ordered list of boundary coordinates going around the perimeter of the concave hull.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bounding Regions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!