function [h] = plotCellcycleTimeseries(sampletimes,y, mainlab,xlab,ylab,ylimit) texty = -1+(max(y)-min(y))/5; phaselines = [0 10 24 38 45 59 73 87 101 108 119]; phasetext={'M/G1','G1','S','G2','M','M/G1','G1','S','G2','M'}; textoffset=-2; plot(sampletimes,y,'.'); hold on h=plot(sampletimes,y, 'LineWidth',2); xlabel(xlab); ylabel(ylab); title(mainlab); ylim(ylimit); xlim([0 max(sampletimes)]) for k=1:length(phaselines)-1 line([phaselines(k) phaselines(k)],ylim, 'LineStyle',':') text((phaselines(k)+phaselines(k+1))/2+textoffset,texty,phasetext{k}, 'FontSize',8); end