Scripting & Custom Tool Plot Legend

Hi Guys,

I have a number of scripts and custom tools that display multiple plots in Views. Is it possible to display a legend for the plots? If not, it would be a useful function to add to both scripting and custom tools.