%% Modify Legend Appearance
% Modify the legend appearance by setting Legend properties. You can set properties when you create the legend using name-value pairs in the legend command. You also can set properties after you create the legend using the Legend object.
% Plot four lines of random data. Create legend and assign the Legend object to the variable lgd. Set the FontSize and TextColor properties using name-value pairs.

rdm = rand(4);
plot(rdm)

lgd = legend({'Line 1','Line 2','Line 3','Line 4'},...
    'FontSize',12,'TextColor','blue');

%
% Modify the legend after it is created by referring to lgd. Set the NumColumns property using the object dot property name notation.

lgd.NumColumns = 2;

% Copyright 2012 The MathWorks, Inc.