我正在使用这段代码来绘制我的图形,但是我不知道如何添加图例?
library(gplots)
data1 <- as.matrix(read.table('$INPUT_FILE1', header = T))
data2 <- as.matrix(read.table('$INPUT_FILE2', header = T))
data1.experiment <- as.factor(data1[,\"$FACTORS\"])
data1.obs <- as.numeric(data1[,\"$RESPONSE_VAR\"])
data2.obs <- as.numeric(data2[,\"$RESPONSE_VAR\"])
pdf(file = 'MeanPlot.pdf', width=5, height=5)
plotmeans(data2.obs ~ data1.experiment, xlab='$FACTORS', ylab='$RESPONSE_VAR')
plotmeans(data1.obs ~ data1.experiment, xlab='$FACTORS', ylab='$RESPONSE_VAR')发布于 2013-04-25 04:11:25
您尝试过在R中添加图例的常规方法吗?
legend("bottom", c("px", "y"), col=c("blue", "red"), lty = c(1), cex = 0.7)https://stackoverflow.com/questions/16200049
复制相似问题