Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5007 > unrolled thread
| Started by | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| First post | 2011-09-16 09:57 +0000 |
| Last post | 2011-09-16 09:57 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Coloring function Heike Gramberg <heike.gramberg@gmail.com> - 2011-09-16 09:57 +0000
| From | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| Date | 2011-09-16 09:57 +0000 |
| Subject | Re: Coloring function |
| Message-ID | <j4v6is$c9t$1@smc.vnet.net> |
It probably helps to specify ColorFunctionScaling->False. With ColorFunctionScaling->True (which is the default setting)
the arguments of the ColorFunction are scaled to lie between 0 and 1. When ColorFunctionScaling is False, the actual values of
x, y, and z are used. Note that since RGBColor expects its arguments to be between 0 and 1, you would then need to rescale
Abs[x] or x^2+y^2 in your examples by hand. So for your examples you would get
ListPointPlot3D[
Flatten[Table[{i, j, 0}, {i, -30, 30}, {j, -30, 30}], 1],
ColorFunctionScaling -> False,
ColorFunction -> Function[{x, y, z}, RGBColor[Abs[x]/30, 0, 0]]]
and
ListPointPlot3D[
Flatten[Table[{i, j, 0}, {i, -30, 30}, {j, -30, 30}], 1],
ColorFunctionScaling -> False,
ColorFunction ->
Function[{x, y, z}, RGBColor[(x^2 + y^2)/(30^2 + 30^2), 0, 0]]]
Heike.
On 15 Sep 2011, at 10:37, guiwi wrote:
> Hi everybody. I have a general problem with the coloring method of
> ColofFunction. Let's consider a plane of points that one wants to plot
> with ListPointPlot3D. If I want to color the points according to their
> x position, I write:
>
> ListPointPlot3D[Flatten[Table[Table[{i, j, 0}, {j, -30, 30}], {i, -30,
> 30}], 1], ColorFunction -> Function[{x, y, z}, RGBColor[x, 0, 0]]]
>
> and that indeed works. But if I want to color according to the
> absolute value of x and use
>
> ColorFunction -> Function[{x, y, z}, RGBColor[Abs[x], 0, 0]]
>
> the coloring is not symmetrical around the x=0 position, but
> identical to the previous case. Another problem is to obtain a radial
> coloring with
>
> ColorFunction -> Function[{x, y, z}, RGBColor[x^2+y^2, 0, 0]]
>
> where the origin of the radial coloring is not at {0,0} but somewhere
> on the edge of the plot. Anyone knows how to control that coloring ?
> Thanks.
> Guillaume
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web