% subfunction to plot line maps
figure(1);clf;
set(gcf,'paperorientation','portrait')
set(gcf,'paperunits','centimeters');
set(gcf,'papertype','a4letter');
set(gcf,'paperposition',[0 0 15 15]);
hold
h=worldmap(latlim,lonlim);
land = shaperead('landareas.shp', 'UseGeoCoords', true);
k=geoshow(land, 'FaceColor', [1 1 1]);
% plotting each cluster
disp('Plotting figure 1')
for i=1:length(period)
    % plotting each hour trajectory
    disp(['Plotting line version of new particle formation map: ',datestr(period(i),29)]);
    trajend=length(find(latint3D(i,:,1)>-999.99));
    for j=1:trajend
        indexend=length(find(latint3D(i,j,:)>-999.99));
        tempmatrixlat=latint3D(i,j,1:indexend);
        tempmatrixlon=lonint3D(i,j,1:indexend);
        plotm(squeeze(tempmatrixlat),squeeze(tempmatrixlon),'k-');
    end
end
% marking station with cross
linem(poslat,poslon,'wX','linewidth',2,'markersize',20);
%name plot - station name and period
timestring=[datestr(min(period)) {'to'} datestr(max(period))];
titlestring=[num2str(stationname) {} timestring];
title(titlestring,'FontSize',12,'fontweight','bold')    
%plot circle 500km radius
distkm=500; %Distance of radius in km
distdeg = distdim(distkm,'kilometers','deg');
[latc,lonc] = scircle1(poslat,poslon,distdeg);
set(h,'LineStyle','--')
geoshow(latc,lonc)
legend_handle=legend('Lines of NPF',['500km'],'location','South');
% denoting station with cross
linem(poslat,poslon,'X','linewidth',2,'markersize',20,'color',[0 0 0]);
hold off
print -djpeg -r300 map1