1 `printrepartition` <-function(positions, names, colors, styles, widths, corpusname, Xmin, T, doCumulative, structurepositions, strutnames, graphtitle, bande) {
7 if (length(positions) > length(colors)) stop("colors list size too small");
8 if (length(positions) > length(names)) stop("names list size too small");
9 if (length(positions) > length(styles)) stop("styles list size too small");
10 if (length(positions) > length(widths)) stop("widths list size too small");
12 # if (length(structurepositions) > length(strutnames)) stop("structure names list size too small");
14 doCumu <- (doCumulative == "true")
20 # set maxX and maxY the ranges
23 for(i in 1:length(names))
28 d = density(x, bw=bande)
38 for(i in 1:length(names))
40 my <- length(positions[[i]])
47 for(i in 1:length(names))
49 #line styles and width update
50 linestyle = linestyle + 1
54 linewidth = linewidth+ 1
61 y <- c( c(0), y , c(y[[length(x)]]) )
62 x <- c( c(x[[1]]), x , c(maxX) )
64 if(draw == 0)# first draw
69 plot(x, y, type="s", xlab=paste("T = ", maxX), main = graphtitle, ylab="Occurrences", ylim=c(0, maxY), xlim=c(Xmin, maxX), pch=15, col=colors[i], lty=styles[i], lwd=widths[i], xaxs="i", yaxs="i")
73 plot(density(x, bw=bande), type="l", xlab=paste("T = ", maxX), graphtitle, ylab="Density", ylim=c(0, maxY), xlim=c(Xmin, maxX), pch=15, col=colors[i], lty=styles[i], lwd=widths[i], xaxs="i", yaxs="i")
80 points(x, y, type="s", pch=15, col=colors[i], lty=styles[i], lwd=widths[i])
84 points(density(x, bw=bande), type="l", pch=15, col=colors[i], lty=styles[i], lwd=widths[i])
93 for(i in 1:length(names))
94 names[i] = paste(names[i], length(positions[[i]]))
97 legend("topleft", names, inset = .02, col = colors, lty=styles, lwd=widths)
101 if(length(structurepositions) > 0)
103 for(i in 1:length(structurepositions))
106 text(structurepositions[[i]], maxY*0.70, strutnames[[i]], cex = .8, srt=-90, adj = c(0,0))
108 points(structurepositions, y, type="h", ylim=c(0, maxY), xlim=c(Xmin, maxX))