Graphics Reference
In-Depth Information
graph box wage, nooutsides over(occ7) asyvars showyvars legend(off)
Even though the showyvars option
sounds like it would work only with
multiple
25
-variables, it also works when
you combine the over() and asyvars
options. As before, we suppress the
legend in this example using the
legend(off) option.
Uses nlsw.dta & scheme vg teal
y
20
15
10
5
0
Prof
Mgmt
Sales
Cler.
Operat.
Labor
Other
excludes outside values
graph box wage, nooutsides over(occ7) asyvars
legend(label(1 "Professional") label(2 "Management"))
We use the legend(label()) option to
change the labels for the first and
second variables in the legend. Note
that you use a separate label() option
for each bar. This is in contrast to the
relabel() option, where all the label
assignments were placed in one
relabel() option; see Box : Cat axis
(168).
Uses nlsw.dta & scheme vg teal
25
20
15
10
5
0
Professional
Management
Sales
Cler.
Operat.
Labor
Other
excludes outside values
graph box wage, nooutsides over(occ7) asyvars legend(rows(2) colfirst)
In this example, we use the
legend(rows(2) colfirst) options to
display the legend in two rows and to
order the keys by column (instead of
the default, which is by row). This
yields keys that are more adjacent to
the boxes that they label.
Uses nlsw.dta & scheme vg teal
25
20
15
10
5
0
Prof
Mgmt
Sales
Cler.
Operat.
Labor
Other
excludes outside values
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