필터 지우기
필터 지우기

How to superimpose contourf plot over a gray scale image

조회 수: 2 (최근 30일)
Liping
Liping 2013년 7월 6일
댓글: chris crowley 2022년 3월 13일
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
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
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);

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by