PlotLegends won't generate automatically more than 15 labels in v10

We may observe that the automatically generated legend limits the number of legend items to the number of available colors in the given color scheme. Using this utility function:

plot[scheme_] := Plot[Evaluate[Range[20] + x], {x, -5, 5},
   PlotLegends -> "Expressions", PlotStyle -> scheme]

Observe the result for indexed color scheme #42 which has only four colors:

plot[42]

enter image description here

There are eight in #26:

plot[26]

enter image description here

As since there are 21 in #60 all your lines have a legend:

plot[60]

enter image description here

And if you specify a gradient color scheme:

Plot[Evaluate[Range[50] + x], {x, -5, 5}, PlotLegends -> "Expressions", 
 PlotStyle -> "Rainbow"]

enter image description here


You can use indexed colors as color function to generate as many distinct colors as you like. For example, although

Length @ ColorData[97, "ColorList"]

15

we can generate 100 distinct colors mapping ColorData[97] on Range[100]

ColorData[97] /@ Range[100] // CountDistinct

100

ColorData[97, "Range"]

{1, ∞, 1}

ColorData[97, "ColorFunction"]

enter image description here

ColorData[97, "ColorFunction"] // InputForm

enter image description here

A nice illustration suggested by @Mr.Wizard in comments:

ArrayPlot[Partition[ColorData[97] /@ Range[500], 21], 
 Mesh -> All, MeshStyle -> White, ImageSize -> 1 -> 30]

enter image description here

So ... if we use PlotStyle -> (ColorData[97]/@Range[20]) the issue goes away:

Plot[Evaluate[Range[20] + x], {x, -5, 5}, 
 PlotStyle -> (ColorData[97] /@ Range[20]), 
 PlotLegends -> "Expressions"]

enter image description here

and with PlotLegends -> Automatic we get

enter image description here

Note that removing the PlotStyle option or the setting PlotStyle -> 97 or PlotStyle -> ColorData[97] we get only 15 distinct colors:

colorswithdefaultplotstyle =  Cases[Plot[Evaluate[Range[20] + x], {x, -5, 5}, 
    PlotLegends -> "Expressions"], {Directive[_, col_, ___],
   _Line} :>  col, All];

{Length @ #, CountDistinct @ #} & @ colorswithdefaultplotstyle

{20, 15}

This works for all 113 indexed colors.

$Version

11.3 .0 for Microsoft Windows (64 - bit) (March 7, 2018)