Obtain intensity of each pixel in a contour plot?

1 view (last 30 days)
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.

Answers (1)

darova
darova on 12 Mar 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

Categories

Find more on Contour Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!