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 Center および File Exchange2-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