Displaying legend of curves in plots

using different random colors for curves.