Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
Lulu
Lulu el 19 de Oct. de 2023
Respondida: Walter Roberson el 19 de Oct. de 2023
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 comentarios
Lulu
Lulu el 19 de Oct. de 2023
It is an imagesc(). The underlying data has sharp data boudaries.
Dyuman Joshi
Dyuman Joshi el 19 de Oct. de 2023
Could you attach the data? Use the paperclip button to attach.

Iniciar sesión para comentar.

Respuestas (3)

KSSV
KSSV el 19 de Oct. de 2023
[X,Y,Z] = peaks(100) ;
contourf(X,Y,Z)

Voss
Voss el 19 de Oct. de 2023
img = imread('image.png');
imagesc(img)
hold on
contour(mean(img,3),'k')

Walter Roberson
Walter Roberson el 19 de Oct. de 2023
levels = unique(YourData);
contourf(YourData, levels);

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by