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


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!

# closing pdf


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.


Just one of the plots from my data.  I want different colors and plots on the same graph


source to share

1 answer

use points()

to add points to an existing plot



All Articles