diff --git a/cpp/showgraphs.m b/cpp/showgraphs.m index 0bfb52839469439e7be1f2dd7ce663204fc5513e..f9efe4e7088cfebf80fddea00414d73ed856b55b 100644 --- a/cpp/showgraphs.m +++ b/cpp/showgraphs.m @@ -1,5 +1,12 @@ (* ::Package:: *) +Needs["ErrorBarPlots`"] + + +(* ::Section:: *) +(*Visualize graphs*) + + gsraw=Import[NotebookDirectory[]<>"graphdata.m"]; @@ -11,3 +18,24 @@ gs2=Map[Graph[#,GraphLayout->Automatic]&,gsraw[[1]]]; Grid[Partition[gs,10],Frame->All] + + +(* ::Section:: *) +(*Plot triangle counts*) + + +gsraw=Import[NotebookDirectory[]<>"graphdata.m"]; + + +Map[ListPlot[#[[2]],Joined->True,PlotRange->All]&,gsraw[[1;;3]]] + + +averages=Map[{#[[1]],Mean[#[[2,-1000;;-1]]]}&,gsraw]; +averagesGrouped=GatherBy[averages,#[[1]]&]; +averagesErrorBars=Map[ +{{#[[1,1]],Mean[#[[All,2]]]}, +ErrorBar[StandardDeviation[#[[All,2]]]/Sqrt[Length[#]]] +}&,averagesGrouped]; + + +ErrorListPlot[averagesErrorBars,Joined->True,PlotMarkers->Automatic,AxesLabel->{"n","\[LeftAngleBracket]triangles\[RightAngleBracket]"}]