This question is a follow-up to this post: previous post
I have 12 variables, M1, M2, ..., M12, for which I compute certain statistics
You can remove the background from the legend by adding:
+ theme(legend.background=element_rect(colour=NA)
Don't forget to add an last closing parenthesis.