Graphs: Titles, Legends, Notes

Types of title

A title (to be displayed on top of the graph) can be requested with

title("Blood pressure in professors after ten years of service")

A title may extend over several lines; for each line, you will use a new set of quotation marks, as in:

title("Blood pressure in professors" "after ten years of service")

A subtitle may be given as well; just use subtitle in addition to title.

Finally, the axes my be titled as in

xtitle("Age at measurement")
ytitle("Systolic blood pressure RR")

If you don't give titles, the variable labels will by displayed (if they have been defined, of course). To suppress axis titles, use xtitle("") and/or ytitle("")

Font size for titles

The size of titles is changed via the size sub-option. For instance,

xtitle("Time of Measurement", size(medlarge))

will produce a slightly larger font than the default.

help textsizestyle will introduce you to the manifold possibilities of manipulating the size of the title.

Legends

To change Stata's default display of a legend, you can provide labels to be displayed in the legend as follows:

legend( label (1 "Men") label (2 "Women"))

You can also change the order in which labels are displayed:

legend(order (2 1) label (1 "Men") label (2 "Women"))

Finally, a legend you deem unnecessary may be suppressed with the following option:

legend(off)

Notes

A note will typically be displayed in small letters at the left bottom of the graph:

note("Özgul-Harnischfeger data 2004, own calculations")

© W. Ludwig-Mayerhofer, Stata Guide | Last update: 30 Jun 2014