The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: coloring contour plot
Replies: 6   Last Post: Aug 10, 2009 5:55 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Amin Bashi

Posts: 10
Registered: 11/23/07
Re: coloring contour plot
Posted: Aug 10, 2009 8:44 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

try this, userdata value is value of isolines of matrix Z
[X,Y] = meshgrid(-2:.2:2,-2:.2:3);
Z = X.*exp(-X.^2-Y.^2);
[C,h] = contour(X,Y,Z);
h3 = findall(0,'userdata',-0.2,'type','patch')
set(h3,'EdgeColor',[0 0 0])

"Bahari " <> wrote in message <h5ovhi$jug$>...
> 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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.