8
$\begingroup$

In the documentation of Plot, under Options / PlotTheme, there is this example:

Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, PlotTheme -> "Business", PlotStyle -> 96]

I can't find in the documentation what PlotStyle -> Number means. Trial and error indicates this number can be in (0,116), which strikes me as a strange upper bound. The effect seems to be an alteration of the color.

What is the meaning of PlotStyle -> Number?

$\endgroup$
1
  • 3
    $\begingroup$ The number may be an index for ColorData, Table[{n, ColorData[n] /@ Range[5]}, {n, 110, 116}] shows that the ColorData index can go up to 115. 116 may be handled as a special case. $\endgroup$
    – Bob Hanlon
    Commented Apr 7, 2022 at 16:34

1 Answer 1

14
$\begingroup$

The syntax PlotStyle -> n is an abbreviation for using the indexed color scheme: PlotStyle -> ColorData[Number].

There are 114 color schemes available in my version.

$Version
(* "12.3.1 for Microsoft Windows (64-bit) (June 24, 2021)" *)

Max@ColorData["Indexed"]
(* 114 *)

You can make a table of all the colors.

Grid[{#, ColorData[#, "Image"]} & /@ ColorData["Indexed"]]

Mathematica graphics

$\endgroup$

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.