<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258138</link>
    <title>MATLAB Central Newsreader - coloring contour plot</title>
    <description>Feed for thread: coloring contour plot</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 10 Aug 2009 11:16:03 -0400</pubDate>
      <title>coloring contour plot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258138#671889</link>
      <author>Bahari </author>
      <description>Dear All,&lt;br&gt;
I want to color my contour base on value of Z, if Z&amp;lt;=1 the color will be white and if Z&amp;gt;1 the color will be light gray. &lt;br&gt;
I succeed to plot the contour with the label as command below but still not success to coloring it.&lt;br&gt;
&lt;br&gt;
[C,h]=contour(X,Y,Z);&lt;br&gt;
clabel(C,h,'FontSize',10,'Rotation',0);&lt;br&gt;
colormap gray&lt;br&gt;
&lt;br&gt;
Thanks in advance for help.&lt;br&gt;
&lt;br&gt;
Bahari</description>
    </item>
    <item>
      <pubDate>Mon, 10 Aug 2009 12:44:03 -0400</pubDate>
      <title>Re: coloring contour plot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258138#671908</link>
      <author>Amin Bashi</author>
      <description>Bahari&lt;br&gt;
try this, userdata  value is value of isolines of matrix Z&lt;br&gt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br&gt;
[X,Y] = meshgrid(-2:.2:2,-2:.2:3);&lt;br&gt;
Z = X.*exp(-X.^2-Y.^2);&lt;br&gt;
[C,h] = contour(X,Y,Z);&lt;br&gt;
set(h,'ShowText','on','TextStep',get(h,'LevelStep')*2)&lt;br&gt;
h3 = findall(0,'userdata',-0.2,'type','patch')&lt;br&gt;
set(h3,'EdgeColor',[0 0 0])&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Bahari &quot; &amp;lt;baid69@yahoo.co.uk&amp;gt; wrote in message &amp;lt;h5ovhi$jug$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear All,&lt;br&gt;
&amp;gt; I want to color my contour base on value of Z, if Z&amp;lt;=1 the color will be white and if Z&amp;gt;1 the color will be light gray. &lt;br&gt;
&amp;gt; I succeed to plot the contour with the label as command below but still not success to coloring it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; [C,h]=contour(X,Y,Z);&lt;br&gt;
&amp;gt; clabel(C,h,'FontSize',10,'Rotation',0);&lt;br&gt;
&amp;gt; colormap gray&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance for help.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bahari</description>
    </item>
    <item>
      <pubDate>Mon, 10 Aug 2009 13:12:03 -0400</pubDate>
      <title>Re: coloring contour plot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258138#671914</link>
      <author>Bahari </author>
      <description>Thanks Amin Bashi. &lt;br&gt;
&lt;br&gt;
I tried your example but seem not as I expected. The background of contour is black, the label is white and the isoline is colorfull.&lt;br&gt;
I'm not sure what wrong. &lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
&lt;br&gt;
Bahari&lt;br&gt;
&lt;br&gt;
&quot;Amin Bashi&quot; &amp;lt;matlabedu.ir.nospam@gmail.com&amp;gt; wrote in message &amp;lt;h5p4mj$i9b$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Bahari&lt;br&gt;
&amp;gt; try this, userdata  value is value of isolines of matrix Z&lt;br&gt;
&amp;gt; %%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br&gt;
&amp;gt; [X,Y] = meshgrid(-2:.2:2,-2:.2:3);&lt;br&gt;
&amp;gt; Z = X.*exp(-X.^2-Y.^2);&lt;br&gt;
&amp;gt; [C,h] = contour(X,Y,Z);&lt;br&gt;
&amp;gt; set(h,'ShowText','on','TextStep',get(h,'LevelStep')*2)&lt;br&gt;
&amp;gt; h3 = findall(0,'userdata',-0.2,'type','patch')&lt;br&gt;
&amp;gt; set(h3,'EdgeColor',[0 0 0])&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Bahari &quot; &amp;lt;baid69@yahoo.co.uk&amp;gt; wrote in message &amp;lt;h5ovhi$jug$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Dear All,&lt;br&gt;
&amp;gt; &amp;gt; I want to color my contour base on value of Z, if Z&amp;lt;=1 the color will be white and if Z&amp;gt;1 the color will be light gray. &lt;br&gt;
&amp;gt; &amp;gt; I succeed to plot the contour with the label as command below but still not success to coloring it.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; [C,h]=contour(X,Y,Z);&lt;br&gt;
&amp;gt; &amp;gt; clabel(C,h,'FontSize',10,'Rotation',0);&lt;br&gt;
&amp;gt; &amp;gt; colormap gray&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks in advance for help.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bahari</description>
    </item>
    <item>
      <pubDate>Mon, 10 Aug 2009 13:27:02 -0400</pubDate>
      <title>Re: coloring contour plot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258138#671918</link>
      <author>Lorenzo Guerrasio</author>
      <description>You could simply create your colormap and than load it everytime you make a figure.&lt;br&gt;
&lt;br&gt;
&quot;Bahari &quot; &amp;lt;baid69@yahoo.co.uk&amp;gt; wrote in message &amp;lt;h5ovhi$jug$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear All,&lt;br&gt;
&amp;gt; I want to color my contour base on value of Z, if Z&amp;lt;=1 the color will be white and if Z&amp;gt;1 the color will be light gray. &lt;br&gt;
&amp;gt; I succeed to plot the contour with the label as command below but still not success to coloring it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; [C,h]=contour(X,Y,Z);&lt;br&gt;
&amp;gt; clabel(C,h,'FontSize',10,'Rotation',0);&lt;br&gt;
&amp;gt; colormap gray&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance for help.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bahari</description>
    </item>
    <item>
      <pubDate>Mon, 10 Aug 2009 14:07:03 -0400</pubDate>
      <title>Re: coloring contour plot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258138#671927</link>
      <author>Bahari </author>
      <description>Thanks a lot, could you pls give an example to create my own colormap. If I can reverse the colormap gray, I think, a little bit I can solve my problem.&lt;br&gt;
&lt;br&gt;
Another things, I found this from matlab Help: &lt;br&gt;
&quot;[C,h,CF] = contourf(...) returns the contour matrix C as calculated by the function contourc and used by clabel, a vector of handles h to patch graphics objects (instead of a contourgroup object, for compatibility with MATLAB Version 6.5 and earlier) and a contour matrix CF for the filled areas.&quot;&lt;br&gt;
&lt;br&gt;
I think this command can help me to solve my problem but  how to use this &quot;[C,h,CF] = contourf(...)&quot; I'm not so understand. Any one can help?&lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
&lt;br&gt;
Bahari&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Lorenzo Guerrasio&quot; &amp;lt;lorenzo.guerrasio@email.it&amp;gt; wrote in message &amp;lt;h5p776$8pl$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; You could simply create your colormap and than load it everytime you make a figure.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Bahari &quot; &amp;lt;baid69@yahoo.co.uk&amp;gt; wrote in message &amp;lt;h5ovhi$jug$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Dear All,&lt;br&gt;
&amp;gt; &amp;gt; I want to color my contour base on value of Z, if Z&amp;lt;=1 the color will be white and if Z&amp;gt;1 the color will be light gray. &lt;br&gt;
&amp;gt; &amp;gt; I succeed to plot the contour with the label as command below but still not success to coloring it.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; [C,h]=contour(X,Y,Z);&lt;br&gt;
&amp;gt; &amp;gt; clabel(C,h,'FontSize',10,'Rotation',0);&lt;br&gt;
&amp;gt; &amp;gt; colormap gray&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks in advance for help.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bahari</description>
    </item>
    <item>
      <pubDate>Mon, 10 Aug 2009 14:32:03 -0400</pubDate>
      <title>Re: coloring contour plot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258138#671934</link>
      <author>Lorenzo Guerrasio</author>
      <description>there should be several example in help colormap.&lt;br&gt;
&lt;br&gt;
&quot;Bahari &quot; &amp;lt;baid69@yahoo.co.uk&amp;gt; wrote in message &amp;lt;h5p9i7$9gc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Thanks a lot, could you pls give an example to create my own colormap. If I can reverse the colormap gray, I think, a little bit I can solve my problem.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Another things, I found this from matlab Help: &lt;br&gt;
&amp;gt; &quot;[C,h,CF] = contourf(...) returns the contour matrix C as calculated by the function contourc and used by clabel, a vector of handles h to patch graphics objects (instead of a contourgroup object, for compatibility with MATLAB Version 6.5 and earlier) and a contour matrix CF for the filled areas.&quot;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I think this command can help me to solve my problem but  how to use this &quot;[C,h,CF] = contourf(...)&quot; I'm not so understand. Any one can help?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Regards&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bahari&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Lorenzo Guerrasio&quot; &amp;lt;lorenzo.guerrasio@email.it&amp;gt; wrote in message &amp;lt;h5p776$8pl$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; You could simply create your colormap and than load it everytime you make a figure.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;Bahari &quot; &amp;lt;baid69@yahoo.co.uk&amp;gt; wrote in message &amp;lt;h5ovhi$jug$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Dear All,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I want to color my contour base on value of Z, if Z&amp;lt;=1 the color will be white and if Z&amp;gt;1 the color will be light gray. &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I succeed to plot the contour with the label as command below but still not success to coloring it.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; [C,h]=contour(X,Y,Z);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; clabel(C,h,'FontSize',10,'Rotation',0);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; colormap gray&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks in advance for help.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Bahari</description>
    </item>
    <item>
      <pubDate>Mon, 10 Aug 2009 21:55:22 -0400</pubDate>
      <title>Re: coloring contour plot</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/258138#672051</link>
      <author>Bahari </author>
      <description>Thanks Lorenzo Guerrasio,&lt;br&gt;
&lt;br&gt;
This is my solution for this moment:&lt;br&gt;
[C,h]=contourf(X,Y,Z);&lt;br&gt;
clabel(C,h,'FontSize',20,'Rotation',0);&lt;br&gt;
caxis([0.5 1])&lt;br&gt;
colormap gray&lt;br&gt;
&lt;br&gt;
I think this is not a good solution but it work. What I done, after run the program I reverse the colormap manual. So I get what I want.&lt;br&gt;
&lt;br&gt;
If anybody now how to reverse the colormap gray, let me know.&lt;br&gt;
&lt;br&gt;
Any way, thanks for everybody.&lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
&lt;br&gt;
Bahari&lt;br&gt;
&lt;br&gt;
&quot;Lorenzo Guerrasio&quot; &amp;lt;lorenzo.guerrasio@email.it&amp;gt; wrote in message &amp;lt;h5pb13$nnp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; there should be several example in help colormap.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Bahari &quot; &amp;lt;baid69@yahoo.co.uk&amp;gt; wrote in message &amp;lt;h5p9i7$9gc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Thanks a lot, could you pls give an example to create my own colormap. If I can reverse the colormap gray, I think, a little bit I can solve my problem.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Another things, I found this from matlab Help: &lt;br&gt;
&amp;gt; &amp;gt; &quot;[C,h,CF] = contourf(...) returns the contour matrix C as calculated by the function contourc and used by clabel, a vector of handles h to patch graphics objects (instead of a contourgroup object, for compatibility with MATLAB Version 6.5 and earlier) and a contour matrix CF for the filled areas.&quot;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I think this command can help me to solve my problem but  how to use this &quot;[C,h,CF] = contourf(...)&quot; I'm not so understand. Any one can help?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Regards&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bahari&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;Lorenzo Guerrasio&quot; &amp;lt;lorenzo.guerrasio@email.it&amp;gt; wrote in message &amp;lt;h5p776$8pl$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; You could simply create your colormap and than load it everytime you make a figure.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;Bahari &quot; &amp;lt;baid69@yahoo.co.uk&amp;gt; wrote in message &amp;lt;h5ovhi$jug$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Dear All,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I want to color my contour base on value of Z, if Z&amp;lt;=1 the color will be white and if Z&amp;gt;1 the color will be light gray. &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I succeed to plot the contour with the label as command below but still not success to coloring it.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; [C,h]=contour(X,Y,Z);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; clabel(C,h,'FontSize',10,'Rotation',0);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; colormap gray&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Thanks in advance for help.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Bahari</description>
    </item>
  </channel>
</rss>

