diff --git a/triangle_analysis.m b/triangle_analysis.m index 11db583ec5f2efcdd0999b4210afb90e48a2b940..5243b5e2cdbd692e2618b3c65949c2b0c39039be 100644 --- a/triangle_analysis.m +++ b/triangle_analysis.m @@ -71,7 +71,7 @@ Needs["ErrorBarPlots`"] (*Data import*) -gsraw=Import[NotebookDirectory[]<>"data/graphdata_temp2.m"]; +gsraw=Import[NotebookDirectory[]<>"data/graphdata_timeevol.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. *) *) @@ -146,20 +146,53 @@ Show[ListPlot[avgAndProp,AxesOrigin->{0,0},AxesLabel->{"degree-sequence-property (*Plot triangle count over "time" in Markov chain instances*) -numPlots=10; -selectedData=gdata[[1,-1]][[-numPlots;;-1]]; +numPlots=20; +selectedData=gdata[[1,1]][[-numPlots;;-1]]; measureSkip=1; minCount=Min[Map[Min[#[[2]]]&,selectedData]]; maxCount=Max[Map[Max[#[[2]]]&,selectedData]]; maxTime=Max[Map[Length[#[[2]]]&,selectedData]]; -maxTime=30000; -skipPts=Max[1,Round[maxTime/400]]; (* Plotting every point is slow. Plot only once per `skipPts` timesteps *) +(* maxTime=30000; *) +skipPts=Max[1,Round[maxTime/500]]; (* Plotting every point is slow. Plot only once per `skipPts` timesteps *) coarseData=Map[#[[2,1;;maxTime;;skipPts]]&,selectedData]; labels=Map["{n,tau} = "<>ToString[#[[1]]]&,selectedData]; ListPlot[coarseData,Joined->True,PlotRange->{0*minCount,maxCount},DataRange->{0,measureSkip*maxTime},PlotLegends->labels] (* Map[ListPlot[#,Joined->True,PlotRange\[Rule]{minCount,maxCount},DataRange\[Rule]{0,maxTime}]&,coarseData] *) +selectedData=gdata[[1,1]]; +measureSkip=1; +minCount=Min[Map[Min[#[[2]]]&,selectedData]]; +maxCount=Max[Map[Max[#[[2]]]&,selectedData]]; +maxTime=Max[Map[Length[#[[2]]]&,selectedData]]; +maxTime=30000; +skipPts=Max[1,Round[maxTime/100]]; (* Plotting every point is slow. Plot only once per `skipPts` timesteps *) +coarseData=Map[#[[2,1;;maxTime;;skipPts]]&,selectedData]; +labels=Map["{n,tau} = "<>ToString[#[[1]]]&,selectedData]; +plot1=ListPlot[coarseData[[1;;5]],Joined->True,PlotRange->{0*minCount,maxCount},DataRange->{0,measureSkip*maxTime}] +plot2=ListPlot[coarseData[[6;;10]],Joined->True,PlotRange->{0*minCount,maxCount},DataRange->{0,measureSkip*maxTime}] +plot3=ListPlot[coarseData[[11;;15]],Joined->True,PlotRange->{0*minCount,maxCount},DataRange->{0,measureSkip*maxTime}] +plot4=ListPlot[coarseData[[16;;20]],Joined->True,PlotRange->{0*minCount,maxCount},DataRange->{0,measureSkip*maxTime}] + + +(* For export *) +numPlots=20; +selectedData=gdata[[2,1]][[-numPlots;;-1]]; +measureSkip=1; +minCount=Min[Map[Min[#[[2]]]&,selectedData]]; +maxCount=Max[Map[Max[#[[2]]]&,selectedData]]; +maxTime=Max[Map[Length[#[[2]]]&,selectedData]]; +(* maxTime=30000; *) +skipPts=Max[1,Round[maxTime/5000]]; (* Plotting every point is slow. Plot only once per `skipPts` timesteps *) +coarseData=Map[#[[2,1;;maxTime;;skipPts]]&,selectedData]; +labels=Map["{n,tau} = "<>ToString[#[[1]]]&,selectedData]; +plotTimeEvol=ListPlot[coarseData,Joined->True,PlotRange->{0*minCount,maxCount},DataRange->{0,measureSkip*maxTime},Frame->True,FrameLabel->{"timesteps","number of triangles"},ImageSize->300] +(* Map[ListPlot[#,Joined->True,PlotRange\[Rule]{minCount,maxCount},DataRange\[Rule]{0,maxTime}]&,coarseData] *) + + +Export[NotebookDirectory[]<>"plots/timeevol.pdf",plotTimeEvol] + + (* ::Subsection:: *) (*Plot success rate over "time"*)