| Author |
Comment/Response |
Henry Lamb
|
10/16/04 11:45pm
The range of your plotted function is automatically scaled to the range (0, 1). If you want to use Hue, write a function which maps the range of hues to this range.
For example, if you want to plot Sin[x y], and have violet (Hue[.9]) represent the lowest value and red (Hue[0]) represent the highest value, you can do it like this.
ContourPlot[Sin[x y], {x, -Pi, Pi}, {y, -Pi, Pi}, ColorFunction -> (Hue[.9(1 - #]&)];
If you want to use the three-parameter version of Hue, write a function for each of the hue, saturation, and brightness. Here's an example.
ContourPlot[Sin[x y], {x, -Pi, Pi}, {y, -Pi, Pi}, ColorFunction -> (Hue[.75(1 - #), 1 - 1.25(# - 0.5)^2, 1 - 4(# - 0.5)^4]&)];
If you prefer to use RGBColor, do it the same way, with a function for each of Red, Green, and Blue. Be sure that the value of each function falls within the bounds (0, 1) on the domain (0, 1).
URL: , |
|