Scatter plot is the simplest chart which uses cartesian coordinates to display the relation between two variables x and y. It is used to find any trend between the two variables.
This recipe demonstrates how to plot a simple x,y chart in R
We will use an example of no of schools established in 2 states between 1970 and 2014
# years year_x = c('1970','1980', '1990', '2000', '2013', '2014') #no of schools in state1 corresponding to a particular year state_y1 = c(15, 30, 60, 120, 240, 300)
Using plot() function to plot the number of schools vs Year for a state
plot(X, y, type, col, main, xlab, ylab)
plot(year_x, state_y1, col = 'red', main = 'Number of schools vs Year', xlab = 'Year', ylab = 'Number of Schools')