Demo entry 1460929

Bar Plot with Non-numeric Xticks

   

Submitted by anonymous on Mar 04, 2015 at 07:21
Language: Matlab. Code size: 771 Bytes.

% Create data for childhood disease cases
loss = [390.602	228.903	81.091	273.06	24.186	23.852	22.724	26.587 ];
mumps = [20178 23536 34561 37395 36072 32237 18597 9408 ];
chickenPox = [37140 32169 37533 39103 33244 23269 16737 5411 ];
a=['A','A','A','A','A','A','A','A','A','A','A','A']
% Create a vertical bar chart using the bar function
figure
bar(1:8, loss',0.5)

% Set the axis limits
axis([0 9 0 400])
%ax = gca;
%ax.XTickLabel = {'-3\pi','-2\pi','-\pi','0','\pi','2\pi','3\pi'};
set(gca, 'XTickLabel', {'XI','XII','XIII','XIV','XV','XVI','XVII','XVII','A','A','A','A'})

% Add title and axis labels
%title('Total Loss in kWh')
xlabel('Strategy')
ylabel('Computation Time(in seconds) ')

% Add a legend
%legend('Measles', 'Mumps', 'Chicken pox')

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).