Re: (Newbie) Applying colors to surface plots
- To: mathgroup at smc.vnet.net
- Subject: [mg21112] Re: [mg21095] (Newbie) Applying colors to surface plots
- From: Hartmut Wolf <hwolf at debis.com>
- Date: Fri, 17 Dec 1999 01:21:11 -0500 (EST)
- Organization: debis Systemhaus
- References: <199912130452.XAA16397@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Fedder Skovgaard schrieb: > > I would like to apply a given color to a plot such as: > > ParametricPlot3D[sphere[1][a,b]//Evaluate,{a,0,Pi},{b,0,2Pi}] > > I have tried to work with SurfaceColor, but failed to get it to work. It > seems very cumbersome to apply individual light sources to get an even > color on the surface. This is even a larger challenge when combining > several graphics objects and wishing to assign colors to individual > objects. > Dear Fedder, try e.g. << Graphics`Shapes` Show[Graphics3D[{EdgeForm[], {SurfaceColor[Hue[0.35, 0.7, 0.9]], Sphere[]}, {SurfaceColor[Hue[0.15, 1., 0.7]], Cone[0.5, 2, 30]}}]] Or if you want, do: s = {Cos[theta] Sin[phi], Cos[theta] Cos[phi], Sin[theta]}; gs = ParametricPlot3D[s, {phi, 0, 2 Pi}, {theta, -Pi/2, Pi/2}, DisplayFunction -> Identity] c = {r Sin[phi], r Cos[phi], z}; gt = Block[{r = 1/2}, ParametricPlot3D[c, {phi, 0, 2 Pi}, {z, -1.5, 1.5}, DisplayFunction -> Identity]] Show[MapAt[({EdgeForm[GrayLevel[0.5]], SurfaceColor[RGBColor[0, 1, 1]], #} &), gs, 1], MapAt[{EdgeForm[], SurfaceColor[GrayLevel[0.3], GrayLevel[1.], 5], #} &, gt, 1], DisplayFunction -> $DisplayFunction] this all gives something colorful. Kind regards, Hartmut
- References:
- (Newbie) Applying colors to surface plots
- From: Fedder Skovgaard <mm46a@imada.sdu.dk>
- (Newbie) Applying colors to surface plots