It’s this latter application that we usually have in mind when we use the term “scatterplot”. In this kind of plot, each observation corresponds to one dot: the horizontal location of the dot plots th...It’s this latter application that we usually have in mind when we use the term “scatterplot”. In this kind of plot, each observation corresponds to one dot: the horizontal location of the dot plots the value of the observation on one variable, and the vertical location displays its value on the other variable. If so, then it’s conventional to plot the cause variable (the predictor) on the x-axis, and the effect variable (the outcome) on the y-axis.
plot( x = parenthood$dan.sleep, # data on the x-axis y = parenthood$dan.grump, # data on the y-axis xlab = "My sleep (hours)", # x-axis label ylab = "My grumpiness (0-100)", # y-axis label xlim = c(0,...plot( x = parenthood$dan.sleep, # data on the x-axis y = parenthood$dan.grump, # data on the y-axis xlab = "My sleep (hours)", # x-axis label ylab = "My grumpiness (0-100)", # y-axis label xlim = c(0,12), # scale the x-axis ylim = c(0,100), # scale the y-axis pch = 20, # change the plot type col = "gray50", # dim the dots slightly frame.plot = FALSE # don't draw a box ) lines( x = c(4,9.5), # the horizontal locations y = c(93,37), # the vertical locations lwd = 2 # line width )