In this tutorial we will be generating and X&Y plot in R, the plot will consist of predefined X and Y variables. We will also be adding labels on both axis as well as chart title.
We begin by defining our two axis, to do this we will make use of the combine function. Our X axis will consist of numbers one to ten and our Y axis will consist of numbers between 100 and 500.
X=c(1:10)
Y=c(100,125,270,302,325,380,390,420,485,500)
To generate the plot we use R’s plot function, here we are also able to add the labels as seen in the snippet of code below
plot(X,Y,xlab="X Label",ylab = "Y Label", main = "Chart Title")
This would give us the following as output.

The full source code for this can be found below.
X=c(1:10)
Y=c(100,125,270,302,325,380,390,420,485,500)
plot(X,Y,xlab="X Label",ylab = "Y Label", main = "Chart Title")