MATLAB: A problem with multiple columns in legend

columnsfigurelegendMATLABplotproperty

Hi all,
I just made the following lines, simply I cannot make a multiple column legend.
If anyone knows how to deal with this, i would be very thankful!
Thanks in advance.
figure
bar(randn(4))
[xx,yy] = legend({'a','b','c','d'}, 'box','off','NumColumns', 4)

Best Answer

You cannot get multiple legend columns when you request the output of the legend icons.
[xx] = legend({'a','b','c','d'}, 'box','off','NumColumns', 4)