A demo for the experimental XYTitleAnnotation class (this is used to place any title, in this case a legend, within the plot area).
XYTitleAnnotation