Coloring different parts in a plot with different color
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Swarnava Pramanik
le 3 Fév 2017
Commenté : Walter Roberson
le 4 Fév 2017
Hi,
I have the following plot and I want to color the complete area where red data are present with a different color as compared to the area where blue data are present. Is there any way to do it? I tried with fill and area functions but no luck. Can anyone please help me with this?

4 commentaires
Walter Roberson
le 4 Fév 2017
Note that your convex hulls can overlap. boundary() can overlap as well but the risk is lower
Réponse acceptée
Walter Roberson
le 4 Fév 2017
Modifié(e) : Walter Roberson
le 4 Fév 2017
You can select the appropriate points, boundary() them, use that to extract an ordered subset of the original points. fill() using those x and y position.
2 commentaires
Image Analyst
le 4 Fév 2017
How do you decide whether to fill an area using fill(), patch(), or area()? What's the difference between them? When would you use each instead of the others?
Walter Roberson
le 4 Fév 2017
area fills between a given y and the y=0 axis.
fill is a front end for patch.
fill creates a filled polygon by calling patch
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Polygons dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!