Placing image above contour lines

I'm having trouble plotting an image and 'contour' lines together. The contour lines are not related to the image. I'm mapping the pressure field of a jet engine and using pcolor and contour to show the pressure map and the image is that of an F-22.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure('Name','105 Hz Field');
pcolor(zt,xt,FieldDBS')
shading interp
hold on
%JET IMAGE
sf = 0.3048;
[F22,~,alpha]=imread('F22_transparent.png');
image([-54 8]*sf,[20 -24]*sf,F22,'alphadata',alpha);
contour(zt,xt,FieldDBS','k');
plot(z0,x0,'marker','o','markersize',6)
title('Engine Condition: AB Narrowband: 105Hz');
xlabel('Z Position');
ylabel('X Position');
colorbar
colormap('Jet')
caxis([70 140])
hold off
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
When I plot them in this order (pcolor, image, contour) the contour obviously plots over the image. However, when I plot them in the order (pcolor, contour, image), I can't get the image to even appear.
I've tried working with imshow and uistack but I haven't got it to work. Any advice ?

답변 (1개)

Sean de Wolski
Sean de Wolski 2011년 7월 13일

0 개 추천

my: FEX: meshCanopy function looks like it does what you want but with a mesh instead of a contour. Change the caller function ( mesh) to contour.
Use
view(2)
to view like an image typically.

댓글 수: 3

Blaine
Blaine 2011년 7월 13일
Thanks for the input. I tried using meshCanopy but my image is a 3D matrix.
If I could somehow use the handles of the contour lines to move them up or down in the figure....
Sean de Wolski
Sean de Wolski 2011년 7월 13일
Like a 3D RGB image or a 3D volume?
Blaine
Blaine 2011년 7월 13일
My image is a <1260x1722x3 uint8> matrix which probably means 3D RGB however I don't use images too often.

댓글을 달려면 로그인하십시오.

카테고리

제품

질문:

2011년 7월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by