Thank you for your reply. I have similar doubts about "theoretical" line.
Let me explain my pipeline
1. I create coverage column for each position of ref genome
$ bedtools coverage -abam some.bam -b fasta.tab -d > cov.txt
extrat last column
cut -f 6 cov.txt > genome_depth
2. In R
tab <- read.table("genome_depth", header = FALSE)
Then I created frequency table of different depths
freq_tab <- as.data.frame(table(tab$V1))
and calculate percent of each length with specific depth value in this table
freq_tab$perc <- with(freq_tab, (100*Freq)/length(tab$V1))
Then I apply simple normalisation by dividing each depth by median depth
dc <- as.numeric(levels(freq_tab$Var1)) and freq_tap$scale_depth <- with(freq_tab, (dc/median(dc)))
And plot this data
plot(freq_tab$scale_depth, cumsum(freq_tab$perc),type="l")
What do you think is this correct way to obtain such graph? When I add the second sample I get this plot http://prntscr.com/dfb05s
They are similar to what I want, but graphics from different samples in the example picture intersect at a certain point which conveniently display slight differences in the slope.