Recently, I have installed Mathmatica 10.4, but I found out that when I use Plot3D, it gives me a mesh. In order to add color, I have to explicitly set ColorFunction.

So I wonder: Is it possible to change the default setting for the ColorFunction?

  • $\begingroup$ I'm a bit confused, maybe you wanted to set PlotStyle instead? $\endgroup$ – J. M.'s technical difficulties May 10 '16 at 10:03
  • 1
    $\begingroup$ You can use something like SetOptions[Plot3D, {ColorFunction -> "Rainbow"}]; and now whenever you call Plot3D it will use that color function. If you want the change to be more permanent (to persist after a kernel restart) then you need to add it to your init.m file $\endgroup$ – Jason B. May 10 '16 at 10:03

To get the Plot3D to look the way it used to, use the option PlotTheme -> "Classic".

Compare the current output,

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]

Mathematica graphics

with what you get with the classic theme,

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, PlotTheme -> "Classic"]

Mathematica graphics

If you want to make that change permanent, then add the line

SetOptions[Plot3D, {PlotTheme -> "Classic"}]

to your init.m file. You could also add color in other ways, with a ColorFunction as you mention, and you can store that option as the default using SetOptions as well.

| improve this answer | |
  • $\begingroup$ Can you be more specific on which "init.m" file shall I add that options?(I'm using Kubuntu) $\endgroup$ – Chuan Chen May 14 '16 at 5:07
  • $\begingroup$ @ChuanChen Evaluate SystemOpen[$UserBaseDirectory\Kernel\init.m] and add it there $\endgroup$ – Jason B. May 14 '16 at 5:14

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