Connecting the Dots for a Scatter Plot
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (3)
Shashank Prasanna
le 3 Mai 2013
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 commentaire
Walter Roberson
le 3 Mai 2013
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 commentaires
Image Analyst
le 3 Mai 2013
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 commentaires
Voir également
Catégories
En savoir plus sur Bounding Regions dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!