%% Open data file
dataf1 = importdata('Fig1.csv');
dndlogdp = dataf1.data(2:289,:);
dndlogdp_norm = dataf1.data(292:end,:);
timef2 = duration(dataf1.textdata(3:end),"InputFormat","hh:mm");
timef2sub1 = timef2(1:288);
timef2sub2 = timef2(291:end);
diam_smps = dataf1.data(1,:);
%% Call new figure
figure("Position",[747,365,897,346])
fig2til = tiledlayout(1,2,"TileSpacing","compact","Padding","compact");
%% Plot the first subplot
nexttile(1)
imagesc(datenum(timef2sub1),diam_smps,dndlogdp');
ax1=gca;
set(ax1,'YDir','normal','XTick',0:3:24,'YScale','log','box','off','YTick',[10 20 50 100 200 400]),ylim([10 414.2]),clim([0 600])
ylabel('Diameter (nm)')
h1=colorbar();
h1.Label.String = 'dN/dlogDp (cm^-^3)';
datetick(ax1)
colormap(viridis);
text(-0.27,0.97,'(a)','Units','normalized','FontSize',16,'FontWeight','bold');
xticklabels({'12:00','18:00','00:00','06:00','12:00'})
ax1.XTickLabelRotation = 0;
%% Plot the second subplot
nexttile(2)
imagesc(datenum(timef2sub2),diam_smps,dndlogdp_norm');
ax2=gca;
set(ax2,'YDir','normal','XTick',0:3:24,'YScale','log','box','off','YTick',[10 20 50 100 200 400]),ylim([10 414.2])
ylabel('Diameter (nm)')
h1=colorbar();
h1.Label.String = 'dN/dlogDp (cm^-^3)';
datetick(ax2)
colormap(viridis);
text(-0.29,0.97,'(b)','Units','normalized','FontSize',16,'FontWeight','bold');
xticklabels({'12:00','18:00','00:00','06:00','12:00'})
ax2.XTickLabelRotation = 0;
xlabel(fig2til,'Local Time','FontSize',14)