How to superimpose contourf plot over a gray scale image
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
dpb
2013 年 7 月 7 日
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...
回答 (1 件)
David Sanchez
2013 年 7 月 8 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!