I'm generating a simple bar-chart with category names on the x-axis. All seems to work fine when the number of categories is 15 or less. For 16 (or more) categories, the chart plots OK but the x-axis labels are not right. I'm using MatLab 2015b.
% Set number of categories.
num_categories = 16;% Create data.
values = rand(1,num_categories);% Create category names.
symbols = ['a':'z'];string_length = 5;for i = 1:num_categories nums = randi(numel(symbols),[1 string_length]); category_name(i) = cellstr(symbols(nums));end% Plot bar-chart.
bar(values)set(gca,'XTickLabel',category_name)set(gca,'XTickLabelRotation',90)
Best Answer