Placing image above contour lines
3 views (last 30 days)
Show older comments
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 ?
0 Comments
Answers (1)
Sean de Wolski
on 13 Jul 2011
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 Comments
See Also
Categories
Find more on Orange in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!