How to superimpose contourf plot over a gray scale image
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
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...
Antworten (1)
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);
1 Kommentar
Siehe auch
Kategorien
Mehr zu Lighting, Transparency, and Shading 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!