Data = readtable('worksheet1.xlsx');
% histogram 1
group1dx = startsWith(Data.mode,'Active');
group1Data = Data{group1dx, 1};
h1 = histogram(group1Data);
group1dx = h1.BinEdges ;
y = h1.Values ;
text(group1dx(1:end-1),y,num2str(y'),'vert','bottom','horiz','center');
% histogram 2
group2dx = startsWith(Data.mode,'NB');
group2Data = Data{group2dx, 1}+1; % Note: add 1 to group2Data to shift it right by one and get duplicate 2023's
hold on
h2=histogram(group2Data);
group2dx = h2.BinEdges ;
y = h2.Values ;
text(group2dx(1:end-1),y,num2str(y'),'vert','bottom','horiz','center');
box off
legend({'Active Fleet: 1,835 Vsls','On Order: 93 Vsls (4.8%)'})
xt = min([group1Data; group2Data]):max([group1Data; group2Data]);
xticks(xt)
% xticklabels are xticks for h1, but for h2 the xticklabels must be adjusted down by 1
xtl = xt;
n_bins_h2 = numel(h2.BinEdges)-1;
xtl(end-n_bins_h2+1:end) = xtl(end-n_bins_h2+1:end)-1;
xticklabels(xtl)