<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172281</link>
    <title>MATLAB Central Newsreader - how to assign different colors to different data points?</title>
    <description>Feed for thread: how to assign different colors to different data points?</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>Wed, 09 Jul 2008 14:18:02 -0400</pubDate>
      <title>how to assign different colors to different data points?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172281#442034</link>
      <author>Zijia Li</author>
      <description>I have a contour graph of Lake Michigan Water Temperature of&lt;br&gt;
different Depth and different time of the year. So on the&lt;br&gt;
x-axis is Dates and Times for a whole year. Y-axis is&lt;br&gt;
depth(on top is 0m and bottom is 140m). The whole contour&lt;br&gt;
graph is colors from blue to red indicating temperature with&lt;br&gt;
a colorbar on the side. &lt;br&gt;
&lt;br&gt;
The problem is that I'm making the same contour graph for&lt;br&gt;
different years. So the automatic color assigned to the&lt;br&gt;
temperature data is different for each year. So for example,&lt;br&gt;
the 0 degrees on the color bar for 2007 is at the darkest&lt;br&gt;
blue, while 0 degrees on the color bar for 2006 is at a much&lt;br&gt;
lighter blue. &lt;br&gt;
&lt;br&gt;
How do I retrieve the color assigned to the temperature data&lt;br&gt;
in 2007 and apply it to 2006's contour graph?&lt;br&gt;
&lt;br&gt;
Any comment and help is appreciated. &lt;br&gt;
By the way I am using matlab 5.3 right now, but newer&lt;br&gt;
version solutions are welcome too.&lt;br&gt;
Thanks </description>
    </item>
    <item>
      <pubDate>Wed, 09 Jul 2008 15:24:02 -0400</pubDate>
      <title>Re: how to assign different colors to different data points?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172281#442062</link>
      <author>Zijia Li</author>
      <description>Also there should be a matrix that matches the color numbers&lt;br&gt;
with the temperature data right?&lt;br&gt;
If I can copy that matrix from 2007 into 2006 contour graph&lt;br&gt;
then it will work right?&lt;br&gt;
I tried retrieving the colormap from 2007 graph and saved it&lt;br&gt;
as &quot;map&quot; and in the 2006 M-file I set colormap(map), but the&lt;br&gt;
colors stayed the same &lt;br&gt;
Or is it that the colorbar keeps this data?&lt;br&gt;
Any help?</description>
    </item>
    <item>
      <pubDate>Wed, 09 Jul 2008 16:32:06 -0400</pubDate>
      <title>Re: how to assign different colors to different data points?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172281#442071</link>
      <author>Peter Boettcher</author>
      <description>&quot;Zijia Li&quot; &amp;lt;triplezzz21@gmail.com&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; I have a contour graph of Lake Michigan Water Temperature of&lt;br&gt;
&amp;gt; different Depth and different time of the year. So on the&lt;br&gt;
&amp;gt; x-axis is Dates and Times for a whole year. Y-axis is&lt;br&gt;
&amp;gt; depth(on top is 0m and bottom is 140m). The whole contour&lt;br&gt;
&amp;gt; graph is colors from blue to red indicating temperature with&lt;br&gt;
&amp;gt; a colorbar on the side. &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The problem is that I'm making the same contour graph for&lt;br&gt;
&amp;gt; different years. So the automatic color assigned to the&lt;br&gt;
&amp;gt; temperature data is different for each year. So for example,&lt;br&gt;
&amp;gt; the 0 degrees on the color bar for 2007 is at the darkest&lt;br&gt;
&amp;gt; blue, while 0 degrees on the color bar for 2006 is at a much&lt;br&gt;
&amp;gt; lighter blue. &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; How do I retrieve the color assigned to the temperature data&lt;br&gt;
&amp;gt; in 2007 and apply it to 2006's contour graph?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Any comment and help is appreciated. &lt;br&gt;
&amp;gt; By the way I am using matlab 5.3 right now, but newer&lt;br&gt;
&amp;gt; version solutions are welcome too.&lt;br&gt;
&lt;br&gt;
&quot;contour&quot; tries to figure out at which temperatures it should draw&lt;br&gt;
contours.  If the datasets are different, it will choose different&lt;br&gt;
temperatures for each dataset, leading to different colors for each&lt;br&gt;
dataset.&lt;br&gt;
&lt;br&gt;
&quot;help contour&quot; (at least on my new version of MATLAB) shows:&lt;br&gt;
&lt;br&gt;
CONTOUR(Z,V) and CONTOUR(X,Y,Z,V) draw LENGTH(V) contour lines &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at the values specified in vector V.&lt;br&gt;
&lt;br&gt;
So if you input the same vector of temperatures into each contour call,&lt;br&gt;
you should get the same colors, and even lines at the same fixed&lt;br&gt;
temperatures.  Maybe -20:5:40 or something.&lt;br&gt;
&lt;br&gt;
-Peter</description>
    </item>
  </channel>
</rss>

