
actionname = 'PD06';

%Start axis is min value of the BH file (BH is put on first)
%startx = min(PD06_BHAccXYZTime);
%End axis is the max value of the BH file
%endx = max(PD06_BHAccXYZTime);

%use the bioharness timing to set the size of figure
settime = PD06_BHAccXYZTime;

%axis(xlim,[startx endx]);

figure('Color','w')


subplot(5,1,1)
plot(PD06_BHAccXYZTime,PD06_BHAccXYZ_Xonly,'r')
hold on
plot(PD06_BHAccXYZTime,PD06_BHAccXYZ_Yonly,'b')
hold on
plot(PD06_BHAccXYZTime,PD06_BHAccXYZ_Zonly,'g')
title('BioHarness Acceleration (chest)')
xlim(settime([1 end]))
datetick('x','HH:MM:SSPM','keepticks')

subplot(5,1,2)
plot(PD06_BodyDynTime,PD06_BodyDyn_accXonly,'r')
hold on
plot(PD06_BodyDynTime,PD06_BodyDyn_accYonly,'b')
hold on
plot(PD06_BodyDynTime,PD06_BodyDyn_accZonly,'g')
title('BodyDyn Acceleration (ankle)')
xlim(settime([1 end]))
datetick('x','HH:MM:SSPM','keepticks')

subplot(5,1,3)
plot(PD06_BodyDynTime,PD06_BodyDyn_gyroXonly,'r')
hold on
plot(PD06_BodyDynTime,PD06_BodyDyn_gyroYonly,'b')
hold on
plot(PD06_BodyDynTime,PD06_BodyDyn_gyroZonly,'g')
title('BodyDyn Gyroscope (ankle)')
xlim(settime([1 end]))
datetick('x','HH:MM:SSPM','keepticks')


subplot(5,1,4)
plot(PD06_E3AccelTime,PD06_E3Accel_Xonly,'r')
hold on
plot(PD06_E3AccelTime,PD06_E3Accel_Yonly,'b')
hold on
plot(PD06_E3AccelTime,PD06_E3Accel_Zonly,'g')
title('E3 Acceleration (wrist)')
xlim(settime([1 end]))
datetick('x','HH:MM:SSPM','keepticks')


subplot(5,1,5)
plot(PD06_BHPeakAccTime,PD06_BHPeakAcc)
title('BioHarness Peak Acceleration (chest)')
xlim(settime([1 end]))
datetick('x','HH:MM:SSPM')
set(gca,'XTick',[settime(1):.025:settime(end)])
xlim(settime([1 end]))
datetick('x','HH:MM:SSPM')

% may have to run this loop outside of the script - for unknown reasons

for i = 1:5;
subplot(5,1,i)
xlim(settime([1 end]))
set(gca,'XTick',[settime(1):.025:settime(end)])

datetick('x','HH:MM:SSPM')
grid on
grid minor
end

ha = axes('Position',[0 0 1 1],'Xlim',[0 1],'Ylim',[0 1],'Box','off','Visible','off','Units','normalized', 'clipping' , 'off');
titlename = sprintf('%s',actionname);
text(0.5, 1,titlename,'HorizontalAlignment','center','VerticalAlignment', 'top')  

hold on
