Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This should be a really simple question, but it isn't in the documentation for some perverse reason. I like the default ColorFunction that Mathematica uses for Plot3D and the like. I'd like to use the same color scheme for other Mathematica plots that don't have it as the automatic default. However, after looking through all of the Color Gradients listed by ColorData["Gradients"] I can't find any that match the effect of just setting ColorFunction->Automatic.

My question: What does Mathematica call its default color palette, why isn't it listed in ColorData, and how can I access it to apply it to other plots?

share|improve this question
    
I think the default color scheme comes from PlotStyle -> White, Lighting -> Automatic, without setting any ColorFunction. – Silvia Jun 25 '13 at 17:18

I think the default color scheme comes from PlotStyle -> White, Lighting -> Automatic, without setting any ColorFunction.

Please compare the results of these two commands:

Row[{
    Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, ImageSize -> 200],
    Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, ImageSize -> 200,
           PlotStyle -> White,
           Lighting -> Automatic]
   }]

image comparison

Also, the documentation for Lighting states "If a color function is given to a plot, then neutral lighting is used automatically". Please compare the results of the following commands:

Row[{
    Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, ImageSize -> 200,
           ColorFunction -> (White &)],
    Show[
         Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, ImageSize -> 200,
                ColorFunction -> (White &)],
         Lighting -> Automatic]
  }]

image comparison 2

share|improve this answer
    
I think this has changed in version 10. Your first example produces slightly different results on my computer. Also do you know the default color/lighting used for version 10 for multiple plots? For example in Plot3D[{Sin[x + y^2], Cos[x + y^2]}, {x, -3, 3}, {y, -2, 2}] there are two surfaces with two different colors (yellow and blue), how can I plot only the second one Plot3D[Cos[x + y^2], {x, -3, 3}, {y, -2, 2}] with the same blue style? – xslittlegrass Sep 17 '15 at 20:13
    
@xslittlegrass Yes I think the default settings has been changed. You need to use PlotStyle -> somecolor, Lighting -> "Neutral" to mimic the default style. But I'm not sure which exact color it is.. – Silvia Sep 19 '15 at 16:28
    
@xslittlegrass I think you can get the colors by this way: Plot3D[Evaluate@Range[10],{x,0,1},{y,0,1},PlotPoints->2,MaxRecursion->0]//Cases‌​[#,Directive[___,c_RGBColor,___]:>c,∞]&. – Silvia Sep 19 '15 at 16:37
    
@xslittlegrass And the Lighting is not "Neutral", it's ............ Lighting->{{"Ambient",RGBColor[0.30100577,0.22414668499999998`,0.090484535]},{"‌​Directional",RGBColor[0.2642166,0.18331229999999998`,0.04261530000000001],ImageSc‌​aled[{0,2,2}]},{"Directional",RGBColor[0.2642166,0.18331229999999998`,0.042615300‌​00000001],ImageScaled[{2,2,2}]},{"Directional",RGBColor[0.2642166,0.1833122999999‌​9998`,0.04261530000000001],ImageScaled[{2,0,2}]}}. – Silvia Sep 19 '15 at 16:43
    
Thanks. But I'm still not able to make it work. See here. By the way how can you get the default lighting information? – xslittlegrass Sep 19 '15 at 19:41

The howto/ChangeTheLightingOfPlots section of the documentation centre specifies the default lighting settings:

Graphics3D[Sphere[], 
 Lighting -> {{"Ambient", 
    RGBColor[{0.312, 0.188, 0.4}]}, {"Directional", 
    RGBColor[{0.8, 0., 0.}], ImageScaled[{2, 0, 2}]}, {"Directional", 
    RGBColor[{0., 0.8, 0.}], ImageScaled[{2, 2, 2}]}, {"Directional", 
    RGBColor[{0., 0., 0.8}], ImageScaled[{0, 2, 2}]}}]

So, the object coloring derives from using colored lights, not from a coloring function.

share|improve this answer
    
Aha I know I saw it somewhere! (+1) – Silvia Jun 25 '13 at 21:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.