how to overlay(superimpose) contour plot(coloured) over a gray scale image
175 ビュー (過去 30 日間)
I am trying to superimpose a colored contour plot on a grayscale image. I used hold on and then i tried to plot a contour plot. Also i tried using two color maps in a same figure window. But even that is not working. Pls do help me in solving this problem. Typically the contour plot occupies only the central part of the greyscale image , the rest is the greyscale image.
Teja Muppirala 2011 年 5 月 3 日
編集済み: Image Analyst 2018 年 11 月 26 日
A grayscale image with a colored contour plot superimposed:
% 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
その他の回答 (3 件)
Walter Roberson 2011 年 5 月 3 日
You haven't indicated what problem you are encountering. Your reference to two color maps hints that you are having getting the two to come out with the colors you want.
Contour plots are a hggroup object that has children that are patch objects. You can change the color properties of the patch objects. The only real trick that have found is that in order to switch between filled and non-filled, you have to change a property in the hggroup object that is the parent of the patch objects.
Sean de Wolski 2011 年 5 月 3 日