Path: news.mathworks.com!newsfeed-00.mathworks.com!panix!bloom-beacon.mit.edu!llnews!53ab2750!not-for-mail
From: Peter Boettcher <boettcher@ll.mit.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to assign different colors to different data points?
References: <g52haq$o1o$1@fred.mathworks.com>
Message-ID: <muyy74bvx15.fsf@G99-Boettcher.llan.ll.mit.edu>
Organization: MIT Lincoln Laboratory
User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.0 (gnu/linux)
Cancel-Lock: sha1:SJm1+9LyWDmp5rauzKYFT4GxeuU=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 39
Date: Wed, 09 Jul 2008 12:32:06 -0400
NNTP-Posting-Host: 155.34.163.114
X-Complaints-To: news@ll.mit.edu
X-Trace: llnews 1215620400 155.34.163.114 (Wed, 09 Jul 2008 12:20:00 EDT)
NNTP-Posting-Date: Wed, 09 Jul 2008 12:20:00 EDT
Xref: news.mathworks.com comp.soft-sys.matlab:478425



"Zijia Li" <triplezzz21@gmail.com> writes:

> I have a contour graph of Lake Michigan Water Temperature of
> different Depth and different time of the year. So on the
> x-axis is Dates and Times for a whole year. Y-axis is
> depth(on top is 0m and bottom is 140m). The whole contour
> graph is colors from blue to red indicating temperature with
> a colorbar on the side. 
>
> The problem is that I'm making the same contour graph for
> different years. So the automatic color assigned to the
> temperature data is different for each year. So for example,
> the 0 degrees on the color bar for 2007 is at the darkest
> blue, while 0 degrees on the color bar for 2006 is at a much
> lighter blue. 
>
> How do I retrieve the color assigned to the temperature data
> in 2007 and apply it to 2006's contour graph?
>
> Any comment and help is appreciated. 
> By the way I am using matlab 5.3 right now, but newer
> version solutions are welcome too.

"contour" tries to figure out at which temperatures it should draw
contours.  If the datasets are different, it will choose different
temperatures for each dataset, leading to different colors for each
dataset.

"help contour" (at least on my new version of MATLAB) shows:

CONTOUR(Z,V) and CONTOUR(X,Y,Z,V) draw LENGTH(V) contour lines 
    at the values specified in vector V.

So if you input the same vector of temperatures into each contour call,
you should get the same colors, and even lines at the same fixed
temperatures.  Maybe -20:5:40 or something.

-Peter