Graphics Reference
In-Depth Information
twoway (scatter ownhome urban) (lfit ownhome urban) (qfit ownhome urban),
legend(order(2 "Linear Fit" 3 "Quadratic Fit")
rows(1) pos(5) title("Legend", position(11)) )
We can add a title, subtitle, note, or
caption to the legend using all the
features described in Standard
options : Titles (313). Here, we add a
title() and use the position()
option to position it in the top left
corner. A simple way to get a smaller
title is to use the subtitle() option
instead.
Uses allstatesdc.dta & scheme vg s2c
20
40
60
80
100
Percent urban 1990
Legend
Linear Fit
Quadratic Fit
twoway (scatter ownhome urban) (lfit ownhome urban) (qfit ownhome urban),
legend(order(2 "Linear Fit" 3 "Quadratic Fit")
rows(1) pos(5) subtitle("Legend", box bexpand ))
To emphasize all the control we have,
we could put the subtitle for the legend
in a box and use bexpand to make it
expand to the width of the legend.
Uses allstatesdc.dta & scheme vg s2c
20
40
60
80
100
Percent urban 1990
Legend
Linear Fit
Quadratic Fit
twoway (scatter ownhome urban) (lfit ownhome urban) (qfit ownhome urban),
legend(order(2 "Linear Fit" 3 "Quadratic Fit")
rows(1) pos(5) note("Fit obtained with lfit and qfit") )
Here, we use the note() option,
showing that we can even add a note to
the legend.
Uses allstatesdc.dta & scheme vg s2c
20
40
60
80
100
Percent urban 1990
Linear Fit
Quadratic Fit
Fit obtained with lfit and qfit
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.
Search WWH ::




Custom Search