diff --git a/triangle_ccm_timeevol_plots.m b/triangle_ccm_timeevol_plots.m index d5503103d7f7cfbdba0d45d48149f385b376d783..fbdee3c7622fddbb0c8ce4bcc4664ee86345f213 100644 --- a/triangle_ccm_timeevol_plots.m +++ b/triangle_ccm_timeevol_plots.m @@ -7,7 +7,7 @@ Needs["ErrorBarPlots`"] (*Plot successrate over time*) -gsraw=Import[NotebookDirectory[]<>"data/graphdata_ccm_timeevol.m"]; +gsraw=Import[NotebookDirectory[]<>"data/graphdata_ccm_cputime.m"]; (* gsraw=SortBy[gsraw,{#[[1,1]]&,#[[1,2]]&}]; (* Sort by n and then by tau. The {} forces a *stable* sort because otherwise Mathematica sorts also on triangle count and other things. *) *) @@ -113,4 +113,39 @@ Export[NotebookDirectory[]<>"plots/timeevol_ccm.pdf",plot1] Export[NotebookDirectory[]<>"plots/timeevol_ccm_log.pdf",plot1log] +(* ::Subsection:: *) +(*New code with CPU time*) + + +getCombinedTimeData[run_]:=Module[{maxTime,skipPts,hhData,ccm1Data,ccm2Data}, +maxTime=Length[run[[3]]]; +skipPts=Max[1,Round[maxTime/500]]; + +hhData= {{0,run[[3,1,2]]}}~Join~run[[3,1;;-1;;skipPts]]; +ccm1Data={{0,run[[4,2,1,2]]}}~Join~run[[4,2,1;;-1;;skipPts]]; +ccm2Data={{0,run[[5,2,1,2]]}}~Join~run[[5,2,1;;-1;;skipPts]]; + +{Legended[hhData,"\[Tau] = "<>ToString[run[[1,2]]]],ccm1Data,ccm2Data} +] + +dataSets=Map[getCombinedTimeData,gdata,{3}]; + + +dataSetsFlattened=Flatten[dataSets,3]; +colorList=Table[ColorData[97,"ColorList"][[1+Floor[i/3]]],{i,0,Length[dataSetsFlattened]-1}]; + + +ListPlot[dataSetsFlattened[[1;;3]],Joined->True,PlotRange->All] + + +z2 + + +plot1=ListPlot[dataSetsFlattened,Joined->True,PlotRange->{All,All},PlotStyle->colorList,ImageSize->300,PlotLabel->nlabels[[1]],Frame->True,FrameLabel->{"seconds","number of triangles"}] + + +Export[NotebookDirectory[]<>"plots/timeevol_ccm.pdf",plot1] +Export[NotebookDirectory[]<>"plots/timeevol_ccm_log.pdf",plot1log] + +