MathGroup Archive 2003

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

Search the Archive

RE: Combining plots and using different colors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42709] RE: [mg42695] Combining plots and using different colors
  • From: "David Park" <djmp at earthlink.net>
  • Date: Tue, 22 Jul 2003 04:40:44 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Vladmira,

Mathematica doesn't make it easy. The following will work.

Needs["Graphics`Colors`"]

pl1 = Graphics3D[Plot3D[2x + y^2, {x, -10, 10}, {y, -10, 10}]];
pl2 = Graphics3D[Plot3D[x + y, {x, -10, 10}, {y, -10, 10}]];

Show[Graphics3D[
      {SurfaceColor[LightCoral], First[pl1],
        SurfaceColor[LightSteelBlue], First[pl2]}],
    BoxRatios -> {1, 1, 1/2},
    ImageSize -> 400];

The only problem with the above is that the standard Mathematica lighting
tends to overwhelm the colors of the surface, unless you use bright
saturated colors.

If you want to try out the DrawGraphics package at my web site you can
combine the different surfaces directly in one plotting statement, you can
use NeutralLighting to tone down the lighting color and allow pastel colored
surfaces to better display, and you can also use ColorMix and EdgeForm to
tone down the mesh on the surface so it is less prominant.

Needs["DrawGraphics`DrawingMaster`"]

Draw3DItems[
    {SurfaceColor[LightCoral], EdgeForm[ColorMix[LightCoral, Black][0.4]],
      Draw3D[2x + y^2, {x, -10, 10}, {y, -10, 10}],

      SurfaceColor[LightSteelBlue],
      EdgeForm[ColorMix[LightSteelBlue, Black][0.4]],
      Draw3D[x + y, {x, -10, 10}, {y, -10, 10}]},

    NeutralLighting[0.3, 0.5, 0, 5°],
    BoxRatios -> {1, 1, 1/2},
    ImageSize -> 400];

Draw3D behaves just like Plot3D except it produces no side plot. You could
also include other plot types such as ParametricDraw3D in the same
statement. The NeutralLighting statement inserts a series of lighting
options. The saturation of the lighting was reduced to 0.3, the brightness
was 0.5, the ambiant light was 0 and the lights were rotated by 5 degrees.
This all gives you shaded colored surfaces.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


From: Vladimira Ilieva [mailto:vilieva at dreman.com]
To: mathgroup at smc.vnet.net

I would greatly appreciate if someone could help me with the following
problem.



I wrote the following simple code.



pl1=Plot3D[2x+y^2, {x,-10,10}, {y,-10,10}];

pl2=Plot3D[x+y, {x,-10,10}, {y,-10,10}, ColorOutput -> CMYKColor];

Show[pl1, pl2]



I tried many different things to have the two graphs in two different colors
when they are plotted together but nothing seems to work. Is it possible to
combine two three dimensional graphs in the same plot in Mathematica and
color them differently?




  • Prev by Date: Cross Platform Compatibility of Packages Between Windows and Mac
  • Next by Date: Re: Re: Eulerian angles
  • Previous by thread: Re: Combining plots and using different colors
  • Next by thread: RE: Combining plots and using different colors