[chronojump] Encoder fixed height on side compare



commit f236f84767e56195c38510c90ae4798302ed6034
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Feb 12 16:17:29 2013 +0100

    Encoder fixed height on side compare

 encoder/graph.R |   35 ++++++++++++++---------------------
 1 files changed, 14 insertions(+), 21 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 3050ca7..1288d0b 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -722,28 +722,21 @@ find.mfrow <- function(n) {
 }
 
 find.yrange <- function(singleFile, rawdata, curves) {
-	if(singleFile) {
-		a=cumsum(rawdata)
-		y.max = max(a)
-		y.min = min(a)
-		if(y.min < 0) {
-			y.max = y.max + -1*y.min
-			y.min = 0
-		}
-		return (c(y.min,y.max))
-	} else {
-		n=length(curves[,1])
-		y.max = 0
-		y.min = 10000
-		for(i in 1:n) { 
-			y.current = cumsum(rawdata[curves[i,1]:curves[i,2]])
-			if(max(y.current) > y.max)
-				y.max = max(y.current)
-			if(min(y.current) < y.min)
-				y.min = min(y.current)
-		}
-		return (c(y.min,y.max))
+	n=length(curves[,1])
+	y.max = 0
+	y.min = 10000
+	for(i in 1:n) { 
+		y.current = cumsum(rawdata[curves[i,1]:curves[i,2]])
+		if(max(y.current) > y.max)
+			y.max = max(y.current)
+		if(min(y.current) < y.min)
+			y.min = min(y.current)
+	}
+	if(y.min < 0) {
+		y.max = y.max + -1*y.min
+		y.min = 0
 	}
+	return (c(y.min,y.max))
 }
 
 quitIfNoData <- function(n, curves, outputData1) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]