Coloring different parts in a plot with different color

조회 수: 1 (최근 30일)
Swarnava Pramanik
Swarnava Pramanik 2017년 2월 3일
댓글: Walter Roberson 2017년 2월 4일
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
Swarnava Pramanik
Swarnava Pramanik 2017년 2월 4일
Hi Image Analyst, The convex hull would be appropriate.
Walter Roberson
Walter Roberson 2017년 2월 4일
Note that your convex hulls can overlap. boundary() can overlap as well but the risk is lower

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2017년 2월 4일
편집: Walter Roberson 2017년 2월 4일
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
Image Analyst
Image Analyst 2017년 2월 4일
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
Walter Roberson 2017년 2월 4일
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polygons에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by