gradientLegend function

Add a gradient legend to a plot.