Writing Greek letters and other symbols in graphs

Greek letters, math symbols, and other symbols (such as Copyright and Trademark symbols) can be incorporated in Stata graphs with the use of SMCL tags. SMCL (Stata Markup and Control Language; pronounced as “smickle”) is used to modify all text output in Stata.

The tag for Greek letters or symbols are of the form {&name}. To illustrate, we will use auto.dta:

#delimit ;

sysuse auto;  /* see note below */

sum price, meanonly;
local p=r(mean);
sum mpg, meanonly;
local m=r(mean);

tw scatter price mpg, xline(m') yline(p’) note(“The verical and horizontal lines correspond” “to {&mu}{subscript:mpg} and {bf:{&mu}{subscript:price}}, respectively.”, pos(2) ring(0)) size(vlarge);

#delimit cr

{&mu} –> lower case Greek letter mu
{subscript:mpg} –> display mpg as a subscript
{bf:{&mu}{subscript:price}} –> display mu with subscript price as bold

For the complete list of symbols, type: “help graph_text”.

Note: -sysuse- is used to to load example datasets that are installed with Stata. To list all data  installed with Stata, type: “sysuse dir”.