Re: 2D-Plot Colorings

• To: mathgroup at smc.vnet.net
• Subject: [mg54281] Re: [mg54218] 2D-Plot Colorings
• From: "Dr A.H. Harker" <a.harker at ucl.ac.uk>
• Date: Wed, 16 Feb 2005 14:36:00 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

``` You can use the Plot3D conventions, and with a little tweaking get a
reasonable-looking graph, with

hh[z_] = If[(z > .2) && (z < .4), RGBColor[0, 0, 1], RGBColor[1, 0, 0]]
Plot3D[x^2, {x, -1, 1}, {y, 0.005, .01}, ColorFunction -> hh,
BoxRatios -> {1, .01, 1}, ColorFunctionScaling -> False,
ViewPoint -> {0, -0.5, 0}, Ticks -> {Automatic, False, Automatic},
Mesh -> False, Lighting -> False];

Which has the merit of not requiring multiple plots, but would require the
viewpoint to be tailored to the problem at hand. I prefer the solutions
previously posted by David Park and DrBob, of course, but thought this might
be fun.

Tony Harker
Department of Physics and Astronomy
University College London
Gower Street
LONDON
WC1E  6BT
(44)(0)207 679 3404
a.harker at ucl.ac.uk

]->-----Original Message-----
]->From: Bruce Colletti [mailto:vze269bv at verizon.net]
To: mathgroup at smc.vnet.net
]->Sent: 14 February 2005 03:17
]->To: mathgroup at smc.vnet.net
]->Subject: [mg54281] [mg54218] 2D-Plot Colorings
]->
]->Re Mathematica 5.1.
]->
]->In plotting y = x^2 over [-1,1], I want to color red those points whose
]->y-values are in [0.2, 0.4].  All others are blue.
]->
]->Although I can do this by manipulating the FullGraphics object or by
]->displaying separate plots, is there an easier way via some Plot option?
]->ColorFunction doesn't seem to work (probably user error), and neither
]->does the Plot3D convention in which shading is co-declared with the
]->function.
]->
]->Thankx.
]->
]->Bruce

```

• Prev by Date: Re: Simplifying an expression in light of relationships between variables?
• Next by Date: Re: Quite Upset with NIntegrate
• Previous by thread: Re: 2D-Plot Colorings
• Next by thread: Re: Re: 2D-Plot Colorings