@@ -27,7 +27,12 @@ evol.prop.graph <- function(gg, volume.stats, net.type, filtered, pub.order, plo
2727{ tlog(2 , " Computing the graph measures" )
2828 filt.txt <- if (filtered ) " filtered" else " unfiltered"
2929 sc.nbr <- length(gg )
30+
3031 narr.unit <- strsplit(gg [[1 ]]$ NarrUnit , split = " _" )[[1 ]][1 ]
32+ # handle narrative unit
33+ if (narr.unit %in% c(" volume" ," arc" ))
34+ plot.vols <- FALSE
35+ narr.unit.map <- c(scene = " Scenes" , chapter = " Chapters" , volume = " Volumes" , arc = " Arcs" )
3136
3237 # order volumes
3338 if (pub.order ) # by publication order
@@ -146,15 +151,15 @@ evol.prop.graph <- function(gg, volume.stats, net.type, filtered, pub.order, plo
146151# ylim=GRAPH_MEASURES[[meas]]$bounds,
147152 xlim = c(1 ,sc.nbr ), ylim = ylim ,
148153 log = if (meas %in% log.y ) " y" else " " ,
149- xlab = " Scenes " , ylab = GRAPH_MEASURES [[meas ]]$ cname
154+ xlab = narr.unit.map [ narr.unit ] , ylab = GRAPH_MEASURES [[meas ]]$ cname
150155 )
151156 # possibly add volume representations
152157 if (plot.vols )
153158 draw.volume.rects(ylim , volume.stats [ord.vols ,], narr.unit = narr.unit )
154159 # add line
155160 lines(
156161 x = 1 : sc.nbr , y = vals ,
157- # xlab="Scenes" , ylab=GRAPH_MEASURES[[meas]]$cname,
162+ # xlab=narr.unit.map[narr.unit] , ylab=GRAPH_MEASURES[[meas]]$cname,
158163 col = col
159164 )
160165 # close file
@@ -191,7 +196,12 @@ evol.prop.vertices <- function(gg, vtx.plot, char.stats, volume.stats, net.type,
191196 tlog(2 , " Computing the vertex measures" )
192197 filt.txt <- if (filtered ) " filtered" else " unfiltered"
193198 sc.nbr <- length(gg )
199+
200+ # handle narrative unit
194201 narr.unit <- strsplit(gg [[1 ]]$ NarrUnit , split = " _" )[[1 ]][1 ]
202+ if (narr.unit %in% c(" volume" ," arc" ))
203+ plot.vols <- FALSE
204+ narr.unit.map <- c(scene = " Scenes" , chapter = " Chapters" , volume = " Volumes" , arc = " Arcs" )
195205
196206 # character names
197207 char.names <- data $ char.stats [,COL_NAME ]
@@ -308,7 +318,7 @@ evol.prop.vertices <- function(gg, vtx.plot, char.stats, volume.stats, net.type,
308318 NULL ,
309319 ylim = ylim , xlim = c(1 ,sc.nbr ),
310320 log = if (meas %in% log.y ) " y" else " " ,
311- xlab = " Scenes " , ylab = NODE_MEASURES [[meas ]]$ cname
321+ xlab = narr.unit.map [ narr.unit ] , ylab = NODE_MEASURES [[meas ]]$ cname
312322 )
313323 # possibly add volume representations
314324 if (plot.vols )
@@ -361,6 +371,7 @@ evol.prop.edges <- function(gg, vtx.plot, char.stats, volume.stats, net.type, fi
361371 narr.unit <- strsplit(gg [[1 ]]$ NarrUnit , split = " _" )[[1 ]][1 ]
362372 if (narr.unit %in% c(" volume" ," arc" ))
363373 plot.vols <- FALSE
374+ narr.unit.map <- c(scene = " Scenes" , chapter = " Chapters" , volume = " Volumes" , arc = " Arcs" )
364375
365376 # character names
366377 char.names <- data $ char.stats [,COL_NAME ]
@@ -487,7 +498,7 @@ evol.prop.edges <- function(gg, vtx.plot, char.stats, volume.stats, net.type, fi
487498 NULL ,
488499 ylim = ylim , xlim = c(1 ,sc.nbr ),
489500 log = if (meas %in% log.y ) " y" else " " ,
490- xlab = " Scenes " , ylab = LINK_MEASURES [[meas ]]$ cname
501+ xlab = narr.unit.map [ narr.unit ] , ylab = LINK_MEASURES [[meas ]]$ cname
491502 )
492503 # possibly add volume representations
493504 if (plot.vols )
0 commit comments