Scatter plots are the most common representation of bivariate relationships. The first command, twoway, specifies that we are working with two variables. The second, scatter variable1 variable2 creates the scatter plot using variable 1 for the y-axis and variable 2 for the x-axis.

The mlabel command relate to labels inside the plot. It uses a pre-defined variable that matches each observation in the plot. The command mlabel adds a label to each observation, it can be a year, a country, region, etc. To label only selected observations, the best way is to modify the variable used to label the plot.

The command mlabelvpos redefines the postioning of each label. Therefore it requires creating a variable with a specific location value for each observation. This is much easier if there are only a few observations to re-position.

The usual graphing commands can be added to improve the clarity of the plot. The commands used here are defined in the histogram tutorial with the addition of a subtitle, subtitle("subtitle") and the modifiers on the title, size(size name) where the size name come from a family of pre-defined parameters (vsmall, small, etc), and color(color name) where the color name corresponds to any common color.

The command (lfit variable 1 variable2) adds a line of best fit to the plot. Usually the same variables as the scatter plot should be used, but it is not necessary if one wants to show a different relationship. For instance, you can use the same variable twice to create a base line against which to compare the data.

Finally, legend(off) and scheme(scheme name) remove the unnecessary legend and changes the color scheme of the graph, where the scheme name corresponds to predefined scheme within Stata.

twoway (scatter variable1 variable2, mlabel(variable) mlabelvpos(variable) xlabel(start(increment)end) ytitle("line1""line2""line3", orientation(horizontal)) ylabel(start(increment)end, angle(0)) title("title", size(size name) color(color name)) subtitle("subtitle") xtitle("xtitle")) (lfit variable1 variable2, legend(off) scheme(scheme name)