function out=handMetaStackedBar(in)

if isequal(class(in),'cell')
    temp=arrayfun(@(x)length (find(categorical(in) == x)), unique(in), 'Uniform', false);
    
    labels=[unique(in) temp];
    labels=sortrows(labels,2);
    out=labels;
    
    temp=cell2mat(labels(:,2));
    temp=[temp zeros(size(temp))*NaN];
    
    bar(temp','stacked');
else
    temp=arrayfun(@(x)length (find(in == x)), unique(in), 'Uniform', false);
    temp=cell2mat(temp);

labels=[unique(in) temp];
labels=sortrows(labels,2);
out=labels;
temp=labels(:,2);
temp=[temp zeros(size(temp))*NaN];

bar(temp','stacked');
end


