diff --git a/triangle_etmt_plots.m b/triangle_etmt_plots.m new file mode 100644 index 0000000000000000000000000000000000000000..2c341f6f6d0dd3c1968f34a290475808e17af321 --- /dev/null +++ b/triangle_etmt_plots.m @@ -0,0 +1,55 @@ +(* ::Package:: *) + +Needs["ErrorBarPlots`"] + + +gsraw=Import[NotebookDirectory[]<>"data/graphdata_etmt_partial.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. *) *) + + +gdata=GatherBy[gsraw,{#[[1,2]]&,#[[1,1]]&}]; +(* Data format: *) +(* gdata[[ tau index, n index, run index , datatype index ]] *) +(* datatype index: +1: {n,tau} +2: etmt +*) +nlabels=Map["n = "<>ToString[#]&,gdata[[1,All,1,1,1]]]; +taulabels=Map["\[Tau] = "<>ToString[#]&,gdata[[All,1,1,1,2]]]; + + +histograms=Map[Histogram[#[[All,2]]]&,gdata,{2}]; + + +histogramsWithLine=Map[Histogram[#[[All,2]],Epilog->Line[{{Mean[N[#[[All,2]]]]+StandardDeviation[N[#[[All,2]]]],0},{Mean[N[#[[All,2]]]]+StandardDeviation[N[#[[All,2]]]],500}}]]&,gdata,{2}]; + + +TableForm[histograms,TableHeadings->{taulabels,nlabels}] + + +gdataSwitched=Transpose[gdata]; +tauChoices={1,3,5,7,9}; +combiHistograms=Map[SmoothHistogram[#[[tauChoices,All,2]],PlotRange->All,PlotLegends->taulabels[[tauChoices]],PlotLabel->"n = "<>ToString[#[[1,1,1,1]]]]&,gdataSwitched,{1}]; + + +combiHistograms[[9]] + + +Export[NotebookDirectory[]<>"plots/ETMTdistribution.pdf",combiHistograms[[9]]] + + +mixingTimesBars=Map[{{#[[1,1,1]],Mean[#[[All,2]]]},ErrorBar[StandardDeviation[#[[All,2]]]]}&,gdata,{2}]; + + +ErrorListPlot[mixingTimesBars[[{1,2,3,5,8}]],Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","ETMT"},PlotLegends->taulabels] + + +mixingTimesDivN=Map[{#[[1,1]],#[[1,2]]/(#[[1,1]])}&,mixingTimesBars,{2}]; +mixingTimesDivNlogN=Map[{#[[1,1]],#[[1,2]]/(#[[1,1]]*Log[#[[1,1]]])}&,mixingTimesBars,{2}]; + + +plotN=ListPlot[mixingTimesDivN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","\[LeftAngleBracket]ETMT\[RightAngleBracket]/n"},PlotLegends->taulabels,ImageSize->300] +plotNlogN=ListPlot[mixingTimesDivNlogN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","\[LeftAngleBracket]ETMT\[RightAngleBracket]/(n log n)"},PlotLegends->taulabels,ImageSize->300] + + +Export[NotebookDirectory[]<>"plots/ETMTdivN.pdf",plotN]