Re: HELP: How to set RGBColor for ContourPlot?
- To: mathgroup at smc.vnet.net
- Subject: [mg17574] Re: HELP: How to set RGBColor for ContourPlot?
- From: "Atul Sharma" <mdsa at musica.mcgill.ca>
- Date: Mon, 17 May 1999 02:14:27 -0400
- References: <7hgddb$4br@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
As explained in the Mathematica Book or in any number of very good introductory texts, the ContourPlot function requires an anonymous color function which will be applied to the function values AFTER they are scaled from 0-1. The following is an example using RGB Color to code the output in tones ranging from blue to pink by varying the amount of red in the 'mix'. ColorFunction->(RGBColor[0.3+ 0.7 #, 0.4, 0.8]&)] For uncomplicated plots, you may find the Hue function easier to use, though it is important to recall that Hue[0] and Hue[1] both give red, which can be confusing if ignored. The following ColorFunction scales the function values to between 1/2 and 1, avoiding this problem. ColorFunction->](Hue[1-#/2] &)] Though I sound like a bit of a broken record today, you might want to check the book Mathematica in Action, Second Edition Stan Wagon (TELOS/Springer-Verlag, 1999) which reviews these issues in excellent detail A. Sharma ___________________________________________________ Atul Sharma MD, FRCP(C) Pediatric Nephrologist, McGill University/Montreal Children's Hospital 2300 Tupper, Montreal, QC, Canada H3H 1P3 email: mdsa at musica.mcgill.ca Tsz Leung YIP wrote in message <7hgddb$4br at smc.vnet.net>... >Hello. How should I set RGBColor for ContourPlot? > >Suppose that I write > >Contour[Sin[x],{x,-Pi,Pi},ColorFunction->RGBColor] > >but it doesn't work. > >Thank you for any help, > >TL Yip > > >