No reason not to program for the PlotStyle
, a bit simple one could say
In[32]:= Plot[Evaluate[Table[BesselJ[n, x], {n, 0, #}]], {x, 0, Pi E GoldenRatio},
PlotStyle -> ReplacePart[Table[Automatic, {# + 1}], {2 -> Dashed, 5 -> Dotted}]] &[8]
to have the second function dashed and the fifth dotted
or you program it
In[39]:= Clear[holman]
holman[o_, p_List, s_List] := ReplacePart[Table[Automatic, {o}],
Rule @@@ Transpose[{p, Take[Flatten[Table[s, {Length[p]}]], Length[p]]}]
] /;Length[p] <= o && Length[s] <= Length[p] && AllTrue[p, 1 <= # <= o &]
In[41]:= Plot[Evaluate[Table[BesselJ[n, x], {n, 0, #}]], {x, 0, Pi E GoldenRatio},
PlotStyle -> holman[#, {2, 5, 9}, {Dashed, Dotted}]] &[10]
to alternate a list s
of style options over a list p
of function numbers:
Consider to improve the function holman
in a way that the style options list is filtered out to contain in the end only plottable directives.