figure;
my_colormap = [255,255,255
153,255,255
51,153,255
0,0,255
0,102,0
0,204,0
0,255,0
255,255,0
204,204,0
255,128,0
255,51,51
204,0,0
204,0,204
178,102,255
204,153,255
229,204,255
]./255;
binEdges = [0 2 4 6 10 15 20 25 30 35 40 50 60 70 80 100] ;
labels = textscan(num2str(binEdges),'%s') ;
labels = labels{1} ;
labels{length(labels)} = [labels{length(labels)} '%'] ;
[~,indices] = histc(shear_DLS_fin,binEdges);
indices(isnan(shear_DLS_fin)) = NaN ;
indices(isinf(shear_DLS_fin)) = NaN ;
[x1,y1] = meshgrid(x_as,y_as);
x_asfin = min(x_as):0.01:max(x_as);
y_asfin = min(y_as):0.01:max(y_as);
[x2,y2] = meshgrid(x_asfin,y_asfin);
imagesc(x_asfin,y_asfin,indices-1)
shading flat
axis equal tight
colormap(gca,my_colormap);
hold on
borders('Countries','LineWidth',3,'Color','black')
xlim([xmin xmax]);
ylim([ymin ymax]);
set(gca,'YDir','normal')
h = colorbar;
caxis([0 length(binEdges)-1])
h.YTickLabel = labels ;
box on
title('Deep layer shear 0-6 km (kt)');
numcolors = 16;
caxis([1 numcolors]);
cbarHandle = colorbar('YTick',...
[1+0.5*(numcolors-1)/numcolors:(numcolors-1)/numcolors:numcolors],...
'YTickLabel',int2str([1:numcolors]'), 'YLim', [1 numcolors]);
cbarHandle =colorbar('YTick',...
[1+0.5*(numcolors-1)/numcolors:(numcolors-1)/numcolors:numcolors],...
'YTickLabel', ...
{'2','4','6','10','15','20','25','30','35','40','50','60','70','80','100','>100'});