function [legend_h,object_h,plot_h,text_strings] = my_columnlegend_2(numcolumns, str, location)
% columnlegend creates a legend with a specified number of columns.
% columnlegend(numcolumns, str, location)
% numcolumns - number of columns in the legend
% cellstr - cell array of strings for the legend
% location - location variable for legend, default is 'NorthEast'
% possible values: 'NorthWest', 'NorthEast', 'SouthEast',
% 'SouthWest'
% example:
% legend_str = [];
% for i=1:10,
% x = 1:i:(10*i);
% plot(x); hold on;
% legend_str = [legend_str; {num2str(i)}];
% end
% columnlegend(3, legend_str, 'NorthWest');
% Author: Simon Henin