How do you plot a line on a function defined by colors?

조회 수: 1 (최근 30일)
Lulu
Lulu 2023년 10월 19일
답변: Walter Roberson 2023년 10월 19일
Hello, I want to plot a line on a color defined function (enclosed example below), such that the line follows the boarders between colors. I don't want to plot a line that roughly follows the color boarders but follows the boarder exactly based on the change in color. However, I am unsure how to acomplish this. Any help appreciated.
Example:
  댓글 수: 3
Lulu
Lulu 2023년 10월 19일
It is an imagesc(). The underlying data has sharp data boudaries.
Dyuman Joshi
Dyuman Joshi 2023년 10월 19일
Could you attach the data? Use the paperclip button to attach.

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

답변 (3개)

KSSV
KSSV 2023년 10월 19일
[X,Y,Z] = peaks(100) ;
contourf(X,Y,Z)

Voss
Voss 2023년 10월 19일
img = imread('image.png');
imagesc(img)
hold on
contour(mean(img,3),'k')

Walter Roberson
Walter Roberson 2023년 10월 19일
levels = unique(YourData);
contourf(YourData, levels);

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by