MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ColorFunction and question about how to use it

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101670] Re: [mg101635] ColorFunction and question about how to use it
  • From: "David Park" <djmpark at comcast.net>
  • Date: Tue, 14 Jul 2009 05:33:40 -0400 (EDT)
  • References: <7364874.1247395571675.JavaMail.root@n11>

You probably want something like the following:

Plot3D[x + y, {x, -2, 2}, {y, -2, 1},
 Mesh -> None,
 PlotStyle -> Opacity[.5, Orange]
 ]

To put fancier color on a surface you could use:

Plot3D[x + y, {x, -2, 2}, {y, -2, 1},
 ColorFunctionScaling -> False,
 Mesh -> None,
 ColorFunction -> Function[{x, y, z}, Hue[Rescale[z, {-4, 2}]]]
 ]

Would it be possible for you to post your function so we could see what the
actual case is?


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: David [mailto:david.b.a.epstein at googlemail.com] 

Here is some Mathematica code


In[2]:=
Plot3D[x + y, {x, -2, 2}, {y, -2, 1},
 ColorFunction -> Function[{x, y, z} -> Hue[z]]]

Plot3D[x + y, {x, -2, 2}, {y, -2, 1}]
----------------------------------------------------------------------------
-
The first Plot3D command gives me only black and white. Why is that?
Otherwise it looks fine.
The second Plot3D command gives me the graph in a uniform blue. Why is
that? Apart from the colour, the two graphs look the same.

What I am actually trying to do is more complicated, but I need to
understand the simplest situations first: I have a given real valued
function f of two variables. I can show that there are exactly two
{x,y} locations at which the two partial derivatives of f are
simultaneously zero. I would like to demonstrate this through Plot3D,
for example by plotting the sum of the squares of the two partial
derivatives. The function surface should be mostly transparent, but
the surface would be coloured (say red) whenever the sum of squares
lies in the closed interval [0,epsilon], with the value of the
positive number epsilon under user control. Transparency would enable
one to see the zeros even if the surface is in the way.

My many attempts to achieve this have all failed.

Thanks for any help.

David




  • Prev by Date: Re: Spell Check on a Mac
  • Next by Date: Re: Add syntax highlighting to own command
  • Previous by thread: Re: ColorFunction and question about how to use it
  • Next by thread: Re: ColorFunction and question about how to use it