Stata Help

Common Plot Options

Listed below are options available with nearly every plot command. There is a very large degree of customization such that this may be one case where you might want to use the generic user interface to alter everything. If you prefer continuing to work with command prompts or just like to know what options graphs have, read on.

Note: Remember your basic syntax and always place a comma between the main command and its options.

Marker Options

The first family of options for a given plot is the marker options. There are ten different marker appearance options controlling everything from marker shape to outline thickness. To learn more about these options type help marker options into the Command window. Click on an option in blue to see its specific help file and what specifications are available.

Marker Label Options

Related to marker options, are marker label options which define if and how the markers are labeled. There are nine different marker labelling options involving everything from which variable is being marked to what color the label is. To learn more about these options type help marker label options into the Command window. Click a topic in blue to learn more about the specifics.

Reference Line Options

Assuming your graph has points it can have a reference line displayed which connects those points. There are seven different aspects of this line which can be specified, involving everything from how the points are connected to the color of the line. To learn more about these options type help cline options into the Command window. Click on a topic in blue to learn more about it.

Lowess Smoothing

Lowess stands for "locally weighted scatterplot smoothing". It is a very calculation intensive process. As an option, it calculates and then adds a a Lowess regression curve to the data. To learn more about making Lowess curves, see help lowess, to learn more about the math, Wikipedia offers a good overview and the original papers on the subject can be found on JSTOR, here (revised) and here (the original). There is also a lowess command (see help lowess for more information).

The lowess option adds the curve, but you can also use the lsopts() option which implies that Stata calculate the lowess smoothing.

Median Splines

Some graphs can also take median splines. In the words of Stata, this involves "calculating the cross medians and then using them as knots to fit a cubic spline which is then graphed". For more information, see the Stata graphics manual [G]'s "graph twoway mspline" entry.

Add Additional plots to the Graph

Sometimes it is useful to put multiple graphs on one graph. This will not work with any command that involves the word graph, but will work with options of other commands that happen to create plots (e.g., acprplots in regression postestimation).Otherwise, construct multiple graphs on one set of axes using a graph command and || (or bars).

After specifying the addplot([plot specifications]) you simply fill in specifications for the graph you want to add just as though you were issuing whatever is conained in addplot() as its own command..

Note: This is just a sample of the many options available when graphing in Stata. If you really want to get into making graphs in Stata, you may want to read the Graphics manual [G].
Back to Estimation

Back to Tutorials