# How to add a BarLegend to a ListLinePlot?

I'm trying to add a color BarLegend to a ListLinePlot with multiple lists. With 20+ lists a normal Legend gets long and bulky. Basically, each list line is associated with a different value. I've created a color gradient for the lines using the Hue function but cannot figure out how to get BarLegend to work with ListLinePlot. I've included a sample of the plot I have so far. It would be a much cleaner presentation with a colorbar for the legend. How do I do this, in an elegant way? I'd even settle for a non-elegant method right now.

• You should be able to use Epilog (or Prolog) and Inset. Have you already created a BarLegend you want to use? Jul 9, 2014 at 3:34
• I'm about to go to bed, so I can't give a full answer. But, you want PlotLegends -> BarLegend[{colorFunction, {xmin, xmax}}] as the option. To place it within the plot, wrap BarLegend in Placed. Jul 9, 2014 at 3:35

ListLinePlot[Table[Accumulate[RandomReal[{-1, 1}, 250]], {10}],