1
$\begingroup$

I would like to plot several functions in one plot and start the standard color rotation (ColorData[97, "ColorList"] // InputForm) from the second color and go on from there. What is the syntax for doing that?

$\endgroup$
1
$\begingroup$

PlotStyle->(ColorData[97][#]&/@Range[2,n+1])

$\endgroup$
  • $\begingroup$ Looks good but trying it, it still starts with the color blue rather than earth. Minimal Example: Plot[{x,x^2}, {x, 0, 180},PlotStyle -> (ColorData[97][#] & /@ Range[2, n + 1])] $\endgroup$ – Asking Questions Apr 14 '16 at 10:14
  • $\begingroup$ You need to set n to the number of functions you are plotting, in this case 2 $\endgroup$ – Quantum_Oli Apr 14 '16 at 10:16
  • $\begingroup$ That works, let's put that into the answer as a note. $\endgroup$ – Asking Questions Apr 14 '16 at 10:17
  • 4
    $\begingroup$ You could just use PlotStyle -> Rest[ColorData[97, "ColorList"]] if I'm reading the question correctly $\endgroup$ – Jason B. Apr 14 '16 at 10:18
  • 1
    $\begingroup$ Or RotateLeft[ColorData[97, "ColorList"]] if you still want the first color, but you want it to come in last $\endgroup$ – Jason B. Apr 14 '16 at 10:19
1
$\begingroup$

Just to be perverse, I suggest making the 1st function a constant that will be skipped in the plotting. This has the advantage that you don't need to know the default color list is no. 97.

Plot[Evaluate @ {0, Sequence @@ Table[Sin[k x], {k, 3}]}, {x, 0, 2. π},
  PlotStyle -> {None, Sequence @@ Table[Automatic, 3]}]

plot

$\endgroup$
  • $\begingroup$ interesting solution $\endgroup$ – Asking Questions Apr 14 '16 at 16:42

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.