diff options
Diffstat (limited to 'R/drfit.R')
-rw-r--r-- | R/drfit.R | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -235,7 +235,7 @@ drfit <- function(data, startlogEC50 = NA, chooseone=TRUE, drplot <- function(drresults, data, dtype = "std", alpha = 0.95, path = "./", fileprefix = "drplot", overlay = FALSE, postscript = FALSE, png = FALSE, bw = TRUE, - colors = 1:8,devoff=T,lpos=FALSE) + colors = 1:8,devoff=T,lpos="topright") { unitlevels <- levels(as.factor(drresults$unit)) if (length(unitlevels) == 1) { @@ -264,15 +264,6 @@ drplot <- function(drresults, data, dtype = "std", alpha = 0.95, } } - # Legend position - if (!lpos[[1]]) { - lx <- lhd - 1 - ly <- hr + 0.1 - } else { - lx <- lpos[[1]] - ly <- lpos[[2]] - } - # Prepare overlay plot if requested if (overlay) { @@ -335,7 +326,7 @@ drplot <- function(drresults, data, dtype = "std", alpha = 0.95, xlab=paste("Decadic Logarithm of the dose in ", unit), ylab="Normalized response") } - if (!overlay) legend("topright", i,lty = 1, col = color, inset=0.05) + if (!overlay) legend(lpos, i,lty = 1, col = color, inset=0.05) tmp$dosefactor <- factor(tmp$dose) # necessary because the old # factor has all levels, not # only the ones tested with @@ -402,7 +393,7 @@ drplot <- function(drresults, data, dtype = "std", alpha = 0.95, } } } - if (overlay) legend("topright", dsubstances,lty = 1, col = colors, inset=0.05) + if (overlay) legend(lpos, dsubstances,lty = 1, col = colors, inset=0.05) if (overlay && (postscript || png)) { if (devoff) { dev.off() @@ -484,7 +475,7 @@ checkplate <- function(plate,db="cytotox") points(log10(drdatalist[[i]]$conc),drdatalist[[i]][[responsetype]],col=i); } - legend(3.0,1.5,substances, pch=1, col=1:length(substances)) + legend("topright",substances, pch=1, col=1:length(substances), inset=0.05) title(main=paste("Plate ",plate," - ",levels(platedata$experimentator)," - ",levels(platedata$type))) } } @@ -540,7 +531,7 @@ checksubstance <- function(substance,db="cytotox",experimentator="%",celltype="% points(log10(platelist[[i]]$conc),platelist[[i]][[responsetype]],col=i); } - legend(3.5,1.7,plates, pch=1, col=1:length(plates)) + legend("topright", plates, pch=1, col=1:length(plates), inset=0.05) title(main=paste(substance," - ",levels(data$experimentator)," - ",levels(data$type))) cat("Substanz ",substance,"\n", |