Obtain intensity of each pixel in a contour plot?

1 visualización (últimos 30 días)
Nicole Ralbovsky
Nicole Ralbovsky el 11 de Mzo. de 2021
Respondida: darova el 12 de Mzo. de 2021
I have generated a contour plot with a dimension size of 101 x 102 pixels. I would like to obtain the "level" of each pixel (which I interpret as being the relative intensity of that pixel) and then reshape that into the same size plot. I know that I can click on each pixel and it will tell me the level, but I was wondering if there was a code I could use to return all intensity values for all pixels. Thanks.

Respuestas (1)

darova
darova el 12 de Mzo. de 2021
You can extract each contour separately
[c,h] = contour(x,y,z);
h1 = get(h,'children');
for i = 1:length(h1)
x = get(h1(i),'xdata');
y = get(h1(i),'ydata');
line(x,y,'color',rand(1,3))
end

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by