Graphics Reference
In-Depth Information
graph hbar ttl exp tenure, over(married) over(urban2)
by(union, cols(1) note("") legend(position(3)) )
We add the legend(position(3))
option to put the legend at the right.
Note that this is contained within the
by() option because it changes the
position of the legend. If we could make
the legend narrow (instead of wide), it
would work well in this position.
Uses nlsw.dta & scheme vg s1c
nonunion
single
Rural
married
single
Metro
married
union
mean of ttl_exp
mean of tenure
single
Rural
married
single
Metro
married
115
graph hbar ttl exp tenure, over(married) over(urban2)
by(union, cols(1) note("") legend(position(3)))
legend(cols(1) stack label(1 "Tot Exp") label(2 "Curr Exp"))
We add the legend(cols(1) stack)
to make the legend narrow and the
label() option to change the labels in
the legend. Note that this legend()
option appears outside of the by()
option. See Options : By (272) and
Options : Legend (287) for more
information about the interactions of
by() and legend() .
Uses nlsw.dta & scheme vg s1c
nonunion
single
Rural
married
single
Metro
married
Tot Exp
union
single
Curr Exp
Rural
married
single
Metro
married
0
5
10
15
graph hbar ttl exp tenure, over(married) over(urban2)
by(union, cols(1) note("") legend(position(3)))
legend(cols(1) stack label(1 "Tot Exp") label(2 "Curr Exp"))
subtitle(, position(5) ring(0) nobexpand)
We can add the subtitle() option to
position the title for each separate
graph in the lower right corner. The
position(5) option puts the title in
the 5 o'clock position, and the ring(0)
option puts the title inside the plot
area. The nobexpand (no box expand)
option keeps the title from expanding
to fill the entire plot area.
Uses nlsw.dta & scheme vg s1c
single
Rural
married
single
Metro
married
nonunion
Tot Exp
single
Rural
Curr Exp
married
single
Metro
married
union
0
5
10
15
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