[chronojump] Encoder: better text on curves plot



commit ab5a7953e89681c7e44ae9bc26418c200bcd32f5
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue May 29 02:49:15 2012 +0200

    Encoder: better text on curves plot

 encoder/graph.R |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 548fd26..c051779 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -459,12 +459,16 @@ if(length(args) < 3) {
 		for(i in 1:length(curves[,1])) { 
 			myLabel = i
 			myY = min(rawdata.cumsum)/10
+			adjVert = 0
 			if(eccon=="ecS") {
 				myEc=c("c","e")
 				myLabel = paste(trunc((i+1)/2),myEc[(i%%2)+1],sep="")
 				myY = rawdata.cumsum[curves[i,1]]/10
+				if(i%%2 == 1) {
+					adjVert = 1
+				}
 			}
-			text(x=(curves[i,1]+curves[i,2])/2,y=myY,labels=myLabel, adj=c(0.5,0),cex=1,col="blue")
+			text(x=(curves[i,1]+curves[i,2])/2,y=myY,labels=myLabel, adj=c(0.5,adjVert),cex=1,col="blue")
 			arrows(x0=curves[i,1],y0=myY,x1=curves[i,2],y1=myY,
 					col="blue",code=3,length=0.1)
 		}



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