Graphics Reference
In-Depth Information
graph pie, over(occ7) by(union, legend(pos(3)) ) legend(cols(1) stack)
Here, we place the legend to the right
using the legend(pos(3)) option.
Note that this option is contained
within the by() option because it alters
the position of the legend. We also
make the legend a single column with
the legend symbols and labels stacked
with the legend(cols(1) stack)
option. Note this option is outside of
the by() option since it does not
determine the position of the legend.
Uses nlsw.dta & scheme vg s2c
nonunion
union
Prof
Mgmt
Sales
Cler.
Operat.
Labor
Other
Graphs by union worker
graph pie, over(occ7) by(union) legend( pos(3) cols(1) stack) sort
This example is similar to the previous
example, but we have added the sort
option. Note that, when we add the
sort option, we need to move the
pos() option from within the by()
option to outside of the by() option.
This is an exception to the general rule
that legend options that control the
position of the legend are placed within
the by() option. Here, we get the
legends that we desire, each to the right
of the pie.
Uses nlsw.dta & scheme vg s2c
nonunion
union
Cler.
Cler.
Operat.
Mgmt
Other
Labor
Labor
Prof
Mgmt
Operat.
Prof
Other
Sales
Sales
Graphs by union worker
graph pie, over(occ7) by(urban3, legend(at(4)) )
Here, we break down occupation by a
three-level variable, leaving a fourth
position open. We can specify the
legend(at(4)) option within the by()
option to place the legend in the space
in the fourth position, conserving space
on the graph.
Uses nlsw.dta & scheme vg s2c
Rural
Suburb
Urban
Prof
Mgmt
Sales
Cler.
Operat.
Labor
Other
Graphs by Rural vs. Suburb vs. Urban
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