# Create sample data
x <- 1:10
y1 <- c(1, 4, 3, 6, 5, 8, 7, 9, 10, 2)
y2 <- c(2, 5, 4, 7, 6, 9, 8, 10, 3, 1)
y3 <- c(3, 6, 5, 8, 7, 10, 9, 2, 4, 1)
# Create an empty plot
plot(x, y1, type = "n", xlim = c(1, 10), ylim = c(0, 10),
xlab = "X", ylab = "Y", main = "Multiple Lines Plot")
# Plot each line one by one
lines(x, y1, type = "l", col = "red")
lines(x, y2, type = "l", col = "blue")
lines(x, y3, type = "l", col = "green")
# Add a legend
legend("topright", legend = c("Line 1", "Line 2", "Line 3"),
col = c("red", "blue", "green"), lty = 1)