Filter löschen
Filter löschen

How to superimpose contourf plot over a gray scale image

1 Ansicht (letzte 30 Tage)
Liping
Liping am 6 Jul. 2013
Kommentiert: chris crowley am 13 Mär. 2022
I'm encountering a problem to superimpose contourf plot over a gray scale image. i uesd "imagesc" to show the gray image and "hold on, contourf" to show the data plot. Also, i tried using two colormaps in a same figure. But that was not working. please give me some advice to overcome it.thank you!
  1 Kommentar
dpb
dpb am 7 Jul. 2013
For what definition of "not working"
I'm not image expert but you'll have make use of transparency to see anything "thru" the top layer...
Show what you did do so a real expert on images can point out specific difficulties. Using one of the sample installed images and providing a generating function (short, preferably) for the contour object would be pluses so can be reproduced easily. Sure, it's not precisely your specific problem but methods are methods...

Melden Sie sich an, um zu kommentieren.

Antworten (1)

David Sanchez
David Sanchez am 8 Jul. 2013
Solution given Teja Muppirala more than a year ago:
%Make some sample grayscale image
I = abs(sin((1:500)'/100)*sin((1:500)/100));
% Convert the grayscale image to RGB
Irgb = cat(3,I,I,I);
%Plot the image and some contours in color
image(Irgb)
hold all
contour(I);

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by