Graphics Reference
In-Depth Information
graph hbar wage, over(occ7) asyvars legend(cols(1) position(9)
stack
)
With the
stack
option, the keys and
their labels are placed on top of each
other to form an even narrower legend,
leaving more room to plot the bars.
You have considerable control over the
elements within the legend using other
options, such as
rowgap()
,
keygap()
,
symxsize()
,
symysize()
,
textwidth()
,and
symplacement()
.
See
Options : Legend
(287) and
[
G
]
legend option
for more details.
Uses nlsw.dta & scheme vg blue
Prof
Mgmt
Sales
Cler.
Operat.
Labor
Other
0
2
4
6
8
10
mean of wage
graph hbar wage, over(occ7) asyvars
This example uses the
vg lgndc
scheme,
set scheme vg lgndc
. Notice
how it positions and customizes the
legend, as in the previous example.
With this scheme, the legend defaults
to the 9 o'clock position, in a single
column, with the keys and symbols
stacked.
Uses nlsw.dta & scheme vg lgndc
Prof
Mgmt
Sales
Cler.
Operat.
Labor
Other
0
2
4
6
8
10
mean of wage
Let's now look at how we can use the
blabel()
(bar label) option to add labels to the
bars. These labels can show the name of the
over()
option, the name of
-variables, or
the height of the bar. These options are illustrated below along with other related options
you might use in conjunction with
blabel()
for identifying the bars. These examples begin
using the
vg past
scheme.
y
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.