Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'color function' topicStudent Support Forum > General > "color function"

Next Comment >Help | Reply To Topic
Author Comment/Response
Rick
10/09/12 00:25am

Hello Everyone:
I have a question regarding contour plots and color functions. I have a function of 2 variable, z = f(x,y) and I want to color the plane using 2 colors only, say Blue and Brown based upon some threshold value for f[x,y]. For example, if z < 1 , then color those regions brown otherwise color the regions blue. I tried (among many other failed attempts)

ContourPlot[f[x,y], {x, xMin, xMax}, {y, yMin, yMax}, ColorFunction -> cfun]

where

cfun[z_] := Which[z < 1, Hue[.63], z >= 1, Hue[.63]]

This colors the entire plane blue. Any suggestions would be greatly appreciated. Thanks.

URL: ,

Subject (listing for 'color function')
Author Date Posted
color function Rick 10/09/12 00:25am
Re: color function Bill Simpson 10/09/12 1:04pm
Next Comment >Help | Reply To Topic