Charts of different lines on one chart
I found an interesting topic about conspiracy, but I'm not happy with the answer. I would like to plot a different number of lines on one graph. Just letting me add as many lines as I want.
I would like to use a library glopts
, but I am open to others. First of all, I want to plot these lines in a pdf file. the script I want to change:
which_rows <- c(12,156,4432) ## I want to choose which row I want to plot
pdf(file='Plots'.pdf)
x <- 1:(ncol(data_plot)-1) ## Can it be changed to use the name of the columns instead of pure numbers ?
for(i in which_rows){
## create new pdf page BUT I WANT TO PLOT IT ON THE SAME GRAPH!
plot(x=x,y=data_plot[i,-1],type='b',main=data_plot[i,1],xlab='columns',ylab='Intensity')
}
# closing pdf
dev.off()
Can you help me modify this script so that it only prints all lines that I select in the same graph? It would be great if you could show me how I can add a new page to this pdf using a different set of lines, eg which_rows2
.
Of course, every plot should have a clear color or something like that.
Edit:
+3
source to share