Graphics Reference
In-Depth Information
twoway (scatter ownhome urban) (lfit ownhome urban) (qfit ownhome urban),
legend(order(1 "% Own Home" 2 "Linear" 3 "Quad")
rows(1) position(12) )
Here, we make the legend a thin row
using the rows(1) option and then use
the position(12) option to put it at
the top of the graph.
Uses allstatesdc.dta & scheme vg s2c
% Own Home
Linear
Quad
20
40
60
80
100
Percent urban 1990
twoway (scatter ownhome urban) (lfit ownhome urban) (qfit ownhome urban),
legend(order(1 "% Own Home" 2 "Linear" 3 "Quad")
rows(1) position(12) bexpand )
We can expand the width of the legend
to the width of the plot area using the
bexpand (box expand) option.
Uses allstatesdc.dta & scheme vg s2c
% Own Home
Linear
Quad
20
40
60
80
100
Percent urban 1990
twoway (scatter ownhome urban) (lfit ownhome urban) (qfit ownhome urban),
legend(order(2 "Linear Fit" 3 "Quadratic Fit")
rows(1) position(12) bexpand span )
If we wanted to expand the legend to
the entire width of the graph area (not
just the plot area), we would add the
span option.
Uses allstatesdc.dta & scheme vg s2c
Linear Fit
Quadratic Fit
20
40
60
80
100
Percent urban 1990
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