comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: modify colors in contour plots
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: modify colors in contour plots [message #79775 is a reply to message #79764] Mon, 02 April 2012 15:10 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
anil writes:

> I have a contour plot of temperature. My temperature range is 4-26
> celsius. I want to have the colors in the contour plot, such that I
> can use lots of colors for the ranges [4-8] and [8-15] . What i want
> to do is to give many colors to the range i want ( 4-8 celsius for my
> case) , a few colors for the range [8-15] and just a single color to
> [15-26] . How can i do this color distribution?

You could do it like this:

data = cgdemodata(2)
data = scale_vector(data, 4.0, 26.0)
levels = scale_vector(findgen(14), 4, 8)
levels = [levels, scale_vector(findgen(8), 8, 15)]
levels = levels[Uniq(levels)]
cgLoadCT, 27, NCOLORS=22, /Brewer
cgContour, data, LEVELS=levels, /Fill, C_Colors=Indgen(22), $
Position=[0.1, 0.1, 0.9, 0.8]
cgContour, data, LEVELS=levels, /Overplot
cgColorbar, XTickV=[4, 11, 18, 25, 26], XTicks=4, $
NColors=22, RANGE=[4,26], $
TickNames=['4', '6', '8', '18', '26'], XMinor=0
END

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Coyote Graphics Raster File Output
Next Topic: Coyote Graphics 8-bit PNG Output

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 13:04:41 PDT 2025

Total time taken to generate the page: 0.80272 seconds