Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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

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.^2-Y.^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




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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.