- #1

- 412

- 2

[tex]

S = f(x, y, z)

[/tex]

so, when f(x, y, z) is maximum, i want the color at (x, y, z) to be say saturated Red [rgb(255, 255, 0)] and when it is minimum, i want the color to be white.

How do i do that in Mathematica?

- Mathematica
- Thread starter rohanprabhu
- Start date

- #1

- 412

- 2

[tex]

S = f(x, y, z)

[/tex]

so, when f(x, y, z) is maximum, i want the color at (x, y, z) to be say saturated Red [rgb(255, 255, 0)] and when it is minimum, i want the color to be white.

How do i do that in Mathematica?

- #2

- 609

- 0

If its the first:

F[x_, y_] = x/Exp[x^2 + y^2];

Plot3D[F[x, y], {x, -2, 2}, {y, -2, 2},

ColorFunction -> Function[{x, y, z}, RGBColor[1, 1 - z, 1 - z]]]

Sort of does what you ask.

- #3

- 412

- 2

- #4

- 609

- 0

Because if its fully opaque you'll only see the bounds of the plot and no data inside. Even so I'll try to do it. I'm thinking your best approach (since theres no such thing as DensityPlot3D) is to have it draw a sphere or cube at each coordinate and color accordingly.

I've done something like this before when trying to make graphics for some 3D Crystalline grain growth simulations. Its a pain and I ended up making my own stuff using OpenDX (which I don't really recommend, its difficult).

so I guess let me ask you this, is your data a function of coordinates, or a table of datapoints?

- #5

- 412

- 2

What I want to do is visualize the behavior of a Spherical Wave. The color at each point should give me the value of the.. let's say Electric Field if it is an EM Wave. Something like:

Because if its fully opaque you'll only see the bounds of the plot and no data inside. Even so I'll try to do it. I'm thinking your best approach (since theres no such thing as DensityPlot3D) is to have it draw a sphere or cube at each coordinate and color accordingly.

I've done something like this before when trying to make graphics for some 3D Crystalline grain growth simulations. Its a pain and I ended up making my own stuff using OpenDX (which I don't really recommend, its difficult).

so I guess let me ask you this, is your data a function of coordinates, or a table of datapoints?

[tex]

X = X_o Sin[k\sqrt{x^2 + y^2 + z^2} + \omega t]

[/tex]

and i want 't' to be manipulated by the parameter supplied through Animate[] rather than Manipulate[], but that's a different thing. Also, in the above case, the greater 'X' is.. the more opaque i want the color to be.

- #6

- 609

- 0

The function Hue[h,s,b,a] the last channel is the alpha.

Maybe theres soemthing you can do in the plot where ColorFunction-> something with Hue[50,50,50,F[x,y,z]] or something.

- #7

- 609

- 0

(Where Alph is the function describing the transparency coordinates as a function of xyz)

F[x_, y_] = x/Exp[x^2 + y^2];

Alph[x_, y_, z_] = z; (*Anything here*)

Plot3D[F[x, y], {x, -2, 2}, {y, -2, 2},

ColorFunction ->

Function[{x, y, z}, RGBColor[1, 0, 0, Alph[x, y, z]]]]

- Last Post

- Replies
- 9

- Views
- 15K

- Last Post

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 2

- Views
- 2K

- Last Post

- Replies
- 3

- Views
- 771

- Replies
- 2

- Views
- 11K

- Last Post

- Replies
- 4

- Views
- 4K

- Last Post

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 1

- Views
- 3K

- Last Post

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 1

- Views
- 746