Skip to content

Commit f267bfa

Browse files
committed
fixed plot file names in post
1 parent b190da8 commit f267bfa

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

src/post/description/_all_post.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ source("src/post/description/avgdist_evol.R")
1515
source("src/post/description/centr_clusters.R")
1616
source("src/post/description/centr_vs_centr.R")
1717
source("src/post/description/centr_vs_occ.R")
18-
#source("src/post/description/char_distr.R")
18+
source("src/post/description/char_distr.R")
1919
#source("src/post/description/char_sim.R")
2020
#source("src/post/description/char_tj_comp.R")
21-
#source("src/post/description/comp_vs_edges.R")
21+
source("src/post/description/comp_vs_edges.R")
2222
#source("src/post/description/comp_vs_vertices.R")
2323
#source("src/post/description/deg_plots.R")
2424
#source("src/post/description/diameters.R")

src/post/description/avgdist_evol.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ for(i in 1:2)
9797
print(summary(fit))
9898

9999
# plot distance as a function of graph order
100-
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=paste0(MEAS_DISTANCE,SFX_AVG), weights="none", filtered=filt.txt, suf=paste0("evolution_",order.txt,"_lines"))
100+
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_MULTI_GRAPH, weights="none", filtered=filt.txt, suf=paste0("distance-average_vs_nodes_",order.txt))
101101
tlog(2, "Plotting in file ",plot.file)
102102
for(fformat in PLOT_FORMAT)
103103
{ if(fformat==PLOT_FORMAT_PDF)
@@ -127,7 +127,7 @@ tlog(0, "Unfiltered/filtered loop complete")
127127

128128
###############################################################################
129129
# same thing, but plots both unfiltered and filtered figures in the same file
130-
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=paste0(MEAS_DISTANCE,SFX_AVG), weights="none", filtered="both", suf=paste0("evolution_",order.txt,"_lines"))
130+
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_MULTI_GRAPH, weights="none", filtered="both", suf=paste0("distance-average_vs_nodes_",order.txt))
131131
tlog(0, "Plotting both unfiltered and filtered results in file ",plot.file)
132132

133133
# process all formats

src/post/description/comp_vs_edges.R

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ if(length(filt.names)==0) stop("Empty list of filtered characters")
3636
g.filt <- delete_vertices(g, V(g)$Filter=="Discard")
3737

3838
# plot settings
39-
xlab <- "Number of edges"
4039
ylab <- "Largest component size (proportion of vertices)"
4140

4241
# compute both types of weights
@@ -46,6 +45,7 @@ wts <- c("Duration","Occurrences")
4645
res <- list()
4746
for(wt in wts)
4847
{ tlog(2, "Dealing with ",wt," weights")
48+
xlab <- paste0("Number of edges, ordered by ",wt)
4949

5050
# remove each edge iteratively
5151
tlog(4, "Removing edges iteratively for the unfiltered graph")
@@ -65,7 +65,7 @@ for(wt in wts)
6565
}
6666
res[[paste0("Unfiltered-",wt)]] <- vals
6767
# plot results
68-
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_LINKWEIGHT, weights=tolower(wt), order="publication", filtered="unfiltered", suf="evolution_lines")
68+
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_MULTI_GRAPH, weights=tolower(wt), filtered="unfiltered", suf="giant-comp-size_vs_links")
6969
tlog(4, "Plotting in file ",plot.file)
7070
for(fformat in PLOT_FORMAT)
7171
{ if(fformat==PLOT_FORMAT_PDF)
@@ -101,7 +101,7 @@ for(wt in wts)
101101
}
102102
res[[paste0("Filtered-",wt)]] <- vals.filt
103103
# plot result
104-
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_LINKWEIGHT, weights=tolower(wt), order="publication", filtered="filtered", suf="comp_vs_edges")
104+
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_MULTI_GRAPH, weights=tolower(wt), filtered="filtered", suf="giant-comp-size_vs_links")
105105
tlog(4, "Plotting in file ",plot.file)
106106
for(fformat in PLOT_FORMAT)
107107
{ if(fformat==PLOT_FORMAT_PDF)
@@ -130,8 +130,9 @@ for(wt in wts)
130130
tlog(0, "Plot figures combining unfiltered and filtered nets results")
131131
for(wt in wts)
132132
{ tlog(2, "Dealing with ",wt," weights")
133+
xlab <- paste0("Number of edges, ordered by ",wt)
133134

134-
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_LINKWEIGHT, weights=tolower(wt), order="publication", filtered="both", suf="comp_vs_edges")
135+
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_MULTI_GRAPH, weights=tolower(wt), filtered="both", suf="giant-comp-size_vs_links")
135136
tlog(4, "Plotting in file ",plot.file)
136137
for(fformat in PLOT_FORMAT)
137138
{ if(fformat==PLOT_FORMAT_PDF)
@@ -157,14 +158,15 @@ for(wt in wts)
157158
legend(
158159
title="Characters",
159160
x="bottomright",
160-
fill=pal["Discard","Keep"],
161+
fill=pal[c("Discard","Keep")],
161162
legend=c("Unfiltered","Filtered")
162163
)
163164
dev.off()
164165
}
165166
}
166167

167168
# both types of weights in the same figure
169+
xlab <- paste0("Number of edges ordered by weight")
168170
tlog(0, "Plot figures combining both types of weights")
169171
for(filtered in c(FALSE,TRUE))
170172
{ if(filtered)
@@ -183,7 +185,7 @@ for(filtered in c(FALSE,TRUE))
183185
}
184186
tlog(2, "Dealing with the ",tolower(fn)," network")
185187

186-
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_LINKWEIGHT, weights="both", order="publication", filtered=filt.txt, suf="comp_vs_edges")
188+
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_MULTI_GRAPH, weights="both", filtered=filt.txt, suf="giant-comp-size_vs_links")
187189
tlog(4, "Plotting in file ",plot.file)
188190
for(fformat in PLOT_FORMAT)
189191
{ if(fformat==PLOT_FORMAT_PDF)
@@ -218,7 +220,8 @@ for(filtered in c(FALSE,TRUE))
218220
}
219221

220222
# all in the same figure
221-
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_LINKWEIGHT, weights="both", order="publication", filtered="both", suf="comp_vs_edges")
223+
plot.file <- get.path.stats.topo(net.type="static", mode="scenes", meas.name=MEAS_MULTI_GRAPH, weights="both", filtered="both", suf="giant-comp-size_vs_links")
224+
xlab <- paste0("Number of edges ordered by weight")
222225
tlog(0, "Plot everything in the same file ",plot.file)
223226
for(fformat in PLOT_FORMAT)
224227
{ if(fformat==PLOT_FORMAT_PDF)
@@ -257,7 +260,7 @@ for(fformat in PLOT_FORMAT)
257260
legend(
258261
title="Characters",
259262
x="topleft",
260-
fill=pal["Discard","Keep"],
263+
fill=pal[c("Discard","Keep")],
261264
legend=c("Unfiltered","Filtered")
262265
)
263266
legend(

0 commit comments

Comments
 (0)