% only colorbar

% clear;
save_file='/home/cflin/Documents/XVoxelv2.3/XVoxel/figure/Cylinders/';

figure
c=colorbar('h');
axis off

u_flg=0;

if u_flg
    clim_range=[0 1.2e-3];
    round_precision=4; 
else
    clim_range=[0 1.4];
%     clim_range=[0 200];
    round_precision=1;
end
clim(clim_range)

% unit_str='mm';
% title(c,unit_str,'fontsize',13,'fontweight','bold');
bar_len=0.9;
bar_wid=0.02;
c.TickLength=bar_wid/4;
c.Position=[(1-bar_len)/2 0.2/2 bar_len bar_wid];

% set precious
if 1
    t=get(c,'Limits');
    the_lines=(linspace(t(1),t(2),5)*10^round_precision);
    if ~(abs(t(1))<1e-8)
        the_lines(1)=ceil(the_lines(1));
    end
    the_lines(end)=round(the_lines(end));

    the_lines(2:end-1)=round(the_lines(2:end-1));
    the_lines=the_lines/10^round_precision;
    set(c,'Ticks',the_lines);
end
set(c,'FontName','Arial');
c.FontSize=10;
colormap('jet');
% set(gcf, 'position', [0 0 700 100]);% set figure size
% c.Ruler.Exponent = 3;
if u_flg
        print(gcf,'-dpng','-r300',[save_file 'u1_colorbar_plus']);
else
%          c.Ruler.Exponent = 3;
        print(gcf,'-dpng','-r300',[save_file 's1_colorbar_plus']); 
end