From 4c96abc6f83b1eefebf806a4697e2bca1ac3d8e5 Mon Sep 17 00:00:00 2001 From: "David Eccles (gringer)" Date: Sat, 22 Apr 2017 23:28:28 +1200 Subject: [PATCH] Fix X axis minimum range for read count histogram --- length_plot.r | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/length_plot.r b/length_plot.r index 8b0e50e..9bdedde 100755 --- a/length_plot.r +++ b/length_plot.r @@ -38,7 +38,8 @@ sequence.hist <- function(lengths, invert = TRUE, ...){ xBreaksMinor <- rep(xBreaksMajor,each=9) * 1:9; xBreaksMinor <- xBreaksMinor[(which.min(xBreaksMinor < axRange[1])): (which.max(xBreaksMinor > axRange[2])-1)]; - barPos <- barplot(if(invert){rev(seqd.bases)} else {seqd.bases}, + barData <- if(invert){rev(seqd.bases)} else {seqd.bases}; + barPos <- barplot(barData, log = "x", las = 1, axes = FALSE, col = "steelblue", horiz = TRUE, names.arg = rep("",length(seqd.bases)), ylab = "", @@ -83,8 +84,7 @@ plain.hist <- function(lengths, invert = TRUE, ...){ barPos <- barplot(log10(if(invert){rev(seqd.counts)} else {seqd.counts})+0.025, las = 1, axes = FALSE, col = "steelblue", horiz = TRUE, names.arg = rep("",length(seqd.counts)), - ylab = "", xlim=c(log10(max(seqd.counts, na.rm=TRUE))+0.025, - log10(min(seqd.counts, na.rm=TRUE))-0.025), + ylab = "", xlim=c(log10(max(seqd.counts, na.rm=TRUE))+0.025,0), xlab = "Number of sequences (Aggregate length)", ...); barGap <- diff(barPos)[1];