Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!w5g2000prd.googlegroups.com!not-for-mail
From: NZTideMan <mulgor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Contour graph help!
Date: Wed, 2 Jul 2008 13:16:43 -0700 (PDT)
Organization: http://groups.google.com
Lines: 30
Message-ID: <ca9f2103-0970-484d-afed-183e4be30104@w5g2000prd.googlegroups.com>
References: <g4g53m$7mf$1@fred.mathworks.com> <g4ggja$d0o$1@fred.mathworks.com> 
NNTP-Posting-Host: 202.78.152.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1215029803 30594 127.0.0.1 (2 Jul 2008 20:16:43 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 2 Jul 2008 20:16:43 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: w5g2000prd.googlegroups.com; posting-host=202.78.152.105; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon; 
X-HTTP-Via: 1.1 nc1 (NetCache NetApp/6.0.5P1)
Xref: news.mathworks.com comp.soft-sys.matlab:477221



On Jul 3, 7:50=A0am, "Zijia Li" <triplezz...@gmail.com> wrote:
> Ok
> So, I when I do contourf(x,y,temp,1000), it makes the graph
> with 1000 colors, but it has a lot of black lines. So I did
> contour(x,y,temp,2000). This makes the graph with 2000
> colors(takes like half and hour to make), which looks really
> good but the legend has 63 different color blocks with
> data1-data63 labeled by it. I don't know where it got the 63
> temperature labels from.
> What I want is one bar of color transitioning from blue to
> red labeled 0C on top by blue and 25C on the bottom by the red.
>
> Can I do that on matlab? If so, how?

This thread has been good fun....
Don't panic!!  You're almost there.
Instead of imposing a large number of contours, start by trying just a
few - like 26 for example (i.e. 1 deg contour levels).
contourf(x,y,temp,26)
This will take less time.  Then once you've got things working you can
increase the number of contour levels.

The reason you saw lots of black lines when you had 2000 contour
levels is that each contour is marked with a black line.  You can turn
this off and have a smooth transition between colours by specifying:
shading interp

I think the 63 colour blocks come from the colormap you are using.
You can play with this and get exactly the range of colours you want.
Type help colormap to see the details of how to do it.