# Sample data
x = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
y = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
# For line Plot
plot(x, y, col = "blue", pch = 16, main = "Scatter Plot of x and y",
xlab = "Variable X", ylab = "Variable Y")
# Additional customization
abline(h = mean(y), col = "red", lty = 2)
text(7, 6, "Mean of Y", col = "red", pos = 4)
# Save the plot
res = recordPlot()
# Clear the Plot Window
plot.new()
# Display the saved plot
res