diff NmrBucketing_script.R @ 3:58679e85745f draft

planemo upload for repository https://github.com/workflow4metabolomics/nmr_bucketing commit 7cd224b2cbddcb2535640a3f76194bd235acb602-dirty
author lecorguille
date Fri, 12 Aug 2016 05:47:27 -0400
parents 761312f27add
children d61f6ceef5d6
line wrap: on
line diff
--- a/NmrBucketing_script.R	Fri Aug 12 03:45:27 2016 -0400
+++ b/NmrBucketing_script.R	Fri Aug 12 05:47:27 2016 -0400
@@ -206,8 +206,11 @@
 
     if (graph == "Overlay")
     {
+      x <- 1:length(bucketedSpectra[,1])
       ymax <- max(bucketedSpectra)
-      plot(1:length(bucketedSpectra[,1]),bucketedSpectra[,1],ylim=c(0,ymax),type='l',col=1,xlab="Chemical shift",ylab="Intensity")
+      plot(x,bucketedSpectra[,1],ylim=c(0,ymax),type='l',col=1,xlab="",xaxt="n",ylab="Intensity")
+      # x-axis labels
+      axis(1, at=seq(1,length(x),by=50),labels=gsub("B","",rownames(bucketedSpectra)[seq(1,length(x),by=50)]), las=2)
       for (i in 2:ncol(bucketedSpectra))
       {
         spectre <- bucketedSpectra[,i]
@@ -219,7 +222,9 @@
     {
       for (i in 1:ncol(bucketedSpectra))
       {
-        plot(1:length(bucketedSpectra[,i]),bucketedSpectra[,i],type='l',col=1,xlab="Chemical shift",ylab="Intensity")
+        x <- 1:length(bucketedSpectra[,1])
+        plot(x,bucketedSpectra[,i],type='l',col=1,xlab="",xaxt="n",ylab="Intensity")
+        axis(1, at=seq(1,length(x),by=50),labels=gsub("B","",rownames(bucketedSpectra)[seq(1,length(x),by=50)]), las=2)
       }
     }
     dev.off()