MATLAB: How to make a vertical label horizontal

bar plotlabel;

Hi, I am trying to give each bar a label. However, when I try to do it, it displays the label vertically, but I would like to have it horizontally otherwise it doesn't fit.. Does anyone know how to do that?? Thanks!!!
x = 1:1:15;
y = vMean(1:15);
name = {'gross', 'comp', 'rate', 'inv', 'gross', 'comp', 'rate', 'inv', 'gross', 'comp', 'rate', 'inv','gross', 'comp', 'rate'}
figure(6);
bar(x,y);
set(get(gca, 'XTicklabel'),'rotation', name);

Best Answer

How about this:
x = 1:15;
y = randi([10 30],size(x));
name = {'gross', 'comp', 'rate', 'inv', 'gross', 'comp', 'rate', 'inv', 'gross', 'comp', 'rate', 'inv','gross', 'comp', 'rate'};
figure(6);clf(6)
bar(x,y);
set(gca, 'XTick',min(x):max(x))
set(gca, 'XTickLabel',name)
set(gca,'XTickLabelRotation', 90)