Graphics Reference
In-Depth Information
graph bar wage, over(age3) over(collgrad, axis(outergap(*20)) )
The axis(outergap(*20)) option
controls the gap between the labels of
the
-axis and the outside of the graph.
As you can see, this increases the space
below the labels for collgrad and the
bottom of the graph.
Uses nlsw.dta & scheme vg s2c
x
34/37
38/41
42/46
34/37
38/41
42/46
not college grad
college grad
graph bar wage, over(union) over(grade4) asyvars
b1title("Education Level in Four Categories")
The b1title() option adds a title to
the bottom of the graph, in effect
labeling the
-axis. We can add a
second title below that using the
b2title() option. If we used graph
hbox , we could label the left axis using
the l1title() and l2title() options.
Uses nlsw.dta & scheme vg s2c
x
Not HS
HS Grad Some Coll Coll Grad
Education Level in Four Categories
nonunion
union
4.5
Controlling legends
This section discusses the use of legends for bar charts, emphasizing the features that
are unique to bar charts. The section Options : Legend (287) goes into great detail about
legends, as does [ G ] legend option . Legends can be used for multiple
y
-variables or when
the first over() variable is treated as a
-variable via the asyvars option. See Bar : Y-
variables (107) for more information about the use of multiple
y
-variables and Bar : Over
(111) for more examples of treating the first over() variable as a
y
y
-variable. Next, we
will consider examples that show the different kinds of labels that you can create using the
blabel() option. You can create labels that display the name of
-variable, the name of
the first over() group, the height of the bar, or the overall height of the bar (when used
with the stack option). These examples begin using the vg s1c scheme.
y
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