diff --git a/cpp/showgraphs.m b/cpp/showgraphs.m index beec01993c5f52bbb41157fe018ab21c4d0297b0..f56096863698088e74f7f69514e24da3384a5a0a 100644 --- a/cpp/showgraphs.m +++ b/cpp/showgraphs.m @@ -31,7 +31,7 @@ Grid[Partition[gs,10],Frame->All] gsraw=Import[NotebookDirectory[]<>"graphdata_merged.m"]; -newData=Import[NotebookDirectory[]<>"graphdata_tau_multi3.m"]; +newData=Import[NotebookDirectory[]<>"graphdata_tau_multi4.m"]; mergedData=Import[NotebookDirectory[]<>"graphdata_merged.m"]; Export[NotebookDirectory[]<>"graphdata_merged_new.m",Join[mergedData,newData]] @@ -44,22 +44,23 @@ maxDegrees=Map[{#[[1]],Max[#[[3]]]}&,gsraw]; maxDegrees=GatherBy[maxDegrees,{#[[1,2]]&,#[[1,1]]&}]; -Histogram[maxDegrees[[1,-1,All,2]],PlotRange->{{0,1100},{0,200}},AxesLabel->{"d_max","frequency"}] -Histogram[maxDegrees[[2,-1,All,2]],PlotRange->{{0,1100},{0,200}},AxesLabel->{"d_max","frequency"}] -Histogram[maxDegrees[[3,-1,All,2]],PlotRange->{{0,1100},{0,200}},AxesLabel->{"d_max","frequency"}] +Histogram[maxDegrees[[1,-1,All,2]],PlotRange->{{0,2000},{0,100}},AxesLabel->{"d_max","frequency"}] +Histogram[maxDegrees[[2,-1,All,2]],PlotRange->{{0,2000},{0,100}},AxesLabel->{"d_max","frequency"}] +Histogram[maxDegrees[[3,-1,All,2]],PlotRange->{{0,2000},{0,100}},AxesLabel->{"d_max","frequency"}] (* ::Subsection:: *) (*Plot triangle count over "time" in Markov chain instances*) -numPlots=10; -minCount=Min[Map[Min[#[[2]]]&,gsraw[[1;;numPlots]]]]; -maxCount=Max[Map[Max[#[[2]]]&,gsraw[[1;;numPlots]]]]; -maxTime=Max[Map[Length[#[[2]]]&,gsraw[[1;;numPlots]]]]; +numPlots=15; +selectedData=gsraw[[-numPlots-1;;-1]]; +minCount=Min[Map[Min[#[[2]]]&,selectedData]]; +maxCount=Max[Map[Max[#[[2]]]&,selectedData]]; +maxTime=Max[Map[Length[#[[2]]]&,selectedData]]; skipPts=Round[maxTime/100]; (* Plotting every point is slow. Plot only once per `skipPts` timesteps *) -coarseData=Map[#[[2,1;;-1;;skipPts]]&,gsraw[[1;;numPlots]]]; -labels=Map["{n,tau} = "<>ToString[#[[1]]]&,gsraw[[1;;numPlots]]]; +coarseData=Map[#[[2,1;;-1;;skipPts]]&,selectedData]; +labels=Map["{n,tau} = "<>ToString[#[[1]]]&,selectedData]; ListPlot[coarseData,Joined->True,PlotRange->{minCount,maxCount},DataRange->{0,maxTime},PlotLegends->labels] (* Map[ListPlot[#,Joined->True,PlotRange\[Rule]{minCount,maxCount},DataRange\[Rule]{0,maxTime}]&,coarseData] *) @@ -69,6 +70,9 @@ ListPlot[coarseData,Joined->True,PlotRange->{minCount,maxCount},DataRange->{0,ma averages=Map[{#[[1]],Mean[#[[2,1;;-1]]]}&,gsraw]; +(* Sort by n *) +averages=SortBy[averages,#[[1,1]]&]; +(* Split by n,tau *) averagesGrouped=GatherBy[averages,{#[[1,1]]&,#[[1,2]]&}]; (* averagesGroupes[[ n index, tau index , run index, {ntau, tri, ds} ]] *) averagesGrouped=Transpose[averagesGrouped]; @@ -84,6 +88,9 @@ ErrorBar[StandardDeviation[#[[All,2]]]/Sqrt[Length[#]]] ErrorListPlot[averagesErrorBars,Joined->True,PlotMarkers->Automatic,AxesLabel->{"n","\[LeftAngleBracket]triangles\[RightAngleBracket]"},PlotLegends->taulabels] +ListLogPlot[averagesErrorBars[[All,All,1]],Joined->True,PlotMarkers->Automatic,AxesLabel->{"n","\[LeftAngleBracket]triangles\[RightAngleBracket]"},PlotLegends->taulabels] + + (* ::Subsection:: *) (*Plot #triangles distribution for specific (n,tau)*)