Graphics Reference
In-Depth Information
twoway (scatter ownhome propval100,
xaxis(1)
mlabel(stateab))
(scatter ownhome borninstate,
xaxis(2)
mlabel(stateab))
Consider this graph in which we overlay
two scatterplots. We place
propval100
on the first
% born in state of residence
40
50
60
70
80
x
-axis and
borninstate
on
80
M
I
MN
MO
M
N
ME
ME
the second
-axis.
Uses allstatesn.dta & scheme vg teal
x
PA
MI
PA
IA
K
S
I
N
VT
V
T
IL
I
N
I
A
NH
WI
N
H
WI
KS
MO
N
E
ND
N
D
SD
NE
OH
SD
O
H
70
IL
C
T
CT
NJ
NJ
MA
MA
R
I
R
I
NY
NY
60
50
DC
DC
40
0
20
40
60
80
100
% homes cost $100K+
% who own home
% who own home
twoway (scatter ownhome propval100, xaxis(1))
(scatter ownhome borninstate, xaxis(2)),
text(43 66 "DC") text(43 42 "DC", xaxis(2))
Rather than labeling all the points, we
can label just the point for
DC
.We
have to be very careful because we have
two different
% born in state of residence
40
50
60
70
80
80
-axes. The first
text()
option uses the first
x
70
-axis, so no
special option is required. The second
text()
option uses the second
x
60
-axis,
so we must specify the
xaxis(2)
option.
Uses allstatesn.dta & scheme vg teal
x
50
DC
DC
40
0
20
40
60
80
100
% homes cost $100K+
% who own home
% who own home
8.11
More options for text and textboxes
This section describes more options for modifying textbox elements: titles, captions,
notes, added text, and legends. Technically, all text in a graph is displayed within a textbox.
We can modify the box's attributes, such as its size and color, the margin around the box,
and the outline; and we can modify the attributes of the text within the box, such as its
size, color, justification, and margin. We sometimes use the
box
option to see how both
the textbox and its text are being displayed. This helps us to see if we should modify the
attributes of the box containing the text or the text within the box. For more information,
see [
G
]
textbox options
and
Options : Adding text
(299). In this section, we will begin by
showing examples illustrating how to control the placement, size, color, and orientation of
text. We will begin this section using the
vg s1m
scheme.
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.