MATLAB: How to make the background of a plot legend transparent

backgroundlegendMATLABtransparent

The default background color of a plot legend is white. I want to make it transparent.

Best Answer

The background of a plot legend can be made transparent by setting the 'color' property of the legend to 'none' . This is shown in the following code sample:
plot(rand(5));
lgnd = legend('one','two','three','four','five');
set(lgnd,'color','none');