
Re: coloring contour plot
Posted:
Aug 10, 2009 8:44 AM


Bahari try this, userdata value is value of isolines of matrix Z %%%%%%%%%%%%%%%%%%%%%%%%%%%% [X,Y] = meshgrid(2:.2:2,2:.2:3); Z = X.*exp(X.^2Y.^2); [C,h] = contour(X,Y,Z); set(h,'ShowText','on','TextStep',get(h,'LevelStep')*2) h3 = findall(0,'userdata',0.2,'type','patch') set(h3,'EdgeColor',[0 0 0])
"Bahari " <baid69@yahoo.co.uk> wrote in message <h5ovhi$jug$1@fred.mathworks.com>... > Dear All, > I want to color my contour base on value of Z, if Z<=1 the color will be white and if Z>1 the color will be light gray. > I succeed to plot the contour with the label as command below but still not success to coloring it. > > [C,h]=contour(X,Y,Z); > clabel(C,h,'FontSize',10,'Rotation',0); > colormap gray > > Thanks in advance for help. > > Bahari

