3
$\begingroup$

I can't find this answer elsewhere, but is there a way to permanently change the default plot color? In 10 the default plots are orangish and in 9 they were a purple-bluish color. Is there a way to change this default value so that every new notebook has the same color scheme?

I'm not worried about the background or text color, just the plot color.

$\endgroup$
2
  • $\begingroup$ Possible duplicate: (4712) $\endgroup$
    – Mr.Wizard
    Commented Jun 19, 2015 at 6:17
  • $\begingroup$ PlotTheme -> "Classic" should give the pre-10 appearance. $\endgroup$ Commented May 16, 2020 at 8:07

2 Answers 2

5
$\begingroup$

Since you claim "the default plots are orangish", I infer that you are working with Plot3D. The coloring of surfaces in a 3D plot can be tricky because there are many options and directives that affect the visible coloring. Some of these options affect the lighting and others the intrinsic coloring.

Let's look at some examples.

Default lighting and coloring

With[{max = 2}, Plot3D[Sin[x y], {x, -max, max}, {y, -max, max},
  PlotTheme -> {"NoAxes", "ZMesh"}]]

default

The intrinsic color is yellow, but most of the visible coloring is an effect of the lighting as the following demonstrates.

Lighting switched to neutral

With[{max = 2}, Plot3D[Sin[x y], {x, -max, max}, {y, -max, max},
  PlotTheme -> {"NoAxes", "ZMesh"},
  Lighting -> "Neutral"]]

neutral

We can choose to dramatically change the visible coloring by changing either the lighting or the intrinsic coloring. Even more complicated things can be done by monkeying with both, but I'm not to go there as this answer is already getting rather long.

Change the lighting

With[{max = 2}, Plot3D[Sin[x y], {x, -max, max}, {y, -max, max},
  PlotTheme -> {"NoAxes", "ZMesh"},
  Lighting -> {{"Directional", RGBColor[0.25, 0.5, 1], {0, 0, 3}}}]]

blue-light

Change the intrinsic color

With[{max = 2},
  Plot3D[Sin[x y], {x, -max, max}, {y, -max, max},
    PlotTheme -> {"NoAxes", "ZMesh"},
    ColorFunction -> (RGBColor[0.25, 0.5, 1] &),
    Lighting -> "Neutral"]]

color_func

What should you carry away from this little demo? That you should read up on the Lighting and the ColorFunction options in the Documentation Center and maybe the PlotTheme option, too.

Making the options of choice into defaults

Suppose you like the look the last plot and want that look to be applied automatically to all Plot3D expressions unless explicitly overridden. To obtain this evaluate:

SetOptions[Plot3D,
  PlotTheme -> {"NoAxes", "ZMesh"},
  ColorFunction -> (RGBColor[0.25, 0.5, 1] &),
  Lighting -> "Neutral"];

Now

With[{max = 2}, Plot3D[Sin[x y], {x, -max, max}, {y, -max, max}]]

gives

color_func

$\endgroup$
2
$\begingroup$
SetOptions[Plot, PlotStyle -> Green]

If you plan to plot several functions simultaneously, you'll need a list of colors, e.g.,

SetOptions[Plot, PlotStyle -> {Green, Blue, Yellow, Purple}]
$\endgroup$
1
  • 2
    $\begingroup$ All of this can be placed in init.m if need be. $\endgroup$ Commented Jun 18, 2015 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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