I have 4 sets of values: y1, y2, y3, y4 and one set x. The y values are of different ranges, and I need to plot them as separate curves with separate sets of values on the y
If you want to go down the path of learning a plotting package beyond the base graphics, here's a solution with ggplot2
using the variables from @Rguy's answer:
library(ggplot2)
dat <- data.frame(x, y1, y2, y3, y4)
dat.m <- melt(dat, "x")
ggplot(dat.m, aes(x, value, colour = variable)) + geom_line() +
facet_wrap(~ variable, ncol = 1, scales = "free_y") +
scale_colour_discrete(legend = FALSE)