3
$\begingroup$

The default color scheme for plots in my Mathematica version is ColorData[1]. What about for the Filling option?

$\endgroup$
3
$\begingroup$

I believe it's the same, but with Opacity[0.2].

(Also, since Mathematica 10 it's ColorData[97] instead of ColorData[1].)

$\endgroup$
  • $\begingroup$ How do you find out the precise default value used for Opacity in Filling? $\endgroup$ – Jules Lamers Aug 28 '17 at 22:29
  • 1
    $\begingroup$ @JulesLamers You can examine the InputForm of the Plot output and look for Opacity directives in it. Plot[1, {x, 0, 1}, PlotPoints -> 2, Filling -> Axis] // InputForm $\endgroup$ – Szabolcs Aug 29 '17 at 6:37
2
$\begingroup$
$Version

"9.0 for Mac OS X x86 (64-bit) (January 24, 2013)"

max = 40;

funcs = #*x & /@ Range[max];

plt = Plot[funcs, {x, 0, 1},
   PlotStyle -> Black,
   Filling -> (Partition[Range[max], 2, 1] /.
      {a_, b_} :> a -> {b})];

The filling colors between the plots are expressed in "HSB", i.e., Hue[{hue, saturation, brightness}]

clr = Cases[plt, {x_Opacity, y_Hue} :> {x, y}, Infinity];

The hue values are

data = clr[[All, 2, 1]];

These align with

hue[n_] := Mod[.67 + (Sqrt[5] - 2) (n - 1), 1]

Plot[hue[n], {n, 0, max},
 Epilog -> {Red, AbsolutePointSize[4],
   Point[Thread[{Range[max - 1], data}]]},
 AxesLabel -> {"n", "hue"}]

enter image description here

The first 15 values of hue correspond to the colors of ColorData1 converted from "RGB" to "HSB"

List @@@ (ColorConvert[#, "RGB" -> "HSB"] & /@ ColorData[1, "ColorList"]) -
   List @@@ (Hue[hue[#], 0.6, 0.6] & /@ Range[15]) // Chop // Union

{{0, 0, 0}}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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