Graphics Reference
In-Depth Information
twoway scatter ownhome borninstate, mlabel(stateab)
Consider this scatterplot showing the
relationship between the percentage of
people in a state who own their home
and the percentage of people born in
their state of residence. We might want
to be able to identify some of the
observations, and we can use the
mlabel() (marker label) option to label
the markers with the two-letter
abbreviation of the state.
Uses allstates3.dta & scheme vg s2c
WV
DE
MS
AL
AR
SC
TN
KY
OK
NC
FL
LA
MD
VA
GA
TX
30
40
50
60
70
80
% born in state of residence
twoway scatter ownhome borninstate, mlabel(stateab) mlabpos(12)
In the previous graph, the marker labels
were all at the 3 o'clock position with
respect to the markers. We can use the
mlabpos() (marker label position)
option to give the marker labels a
different position. In this example, we
place the marker labels in the 12
o'clock position above the markers.
Uses allstates3.dta & scheme vg s2c
WV
DE
MS
AL
AR
SC
TN
KY
OK
NC
FL
LA
MD
VA
GA
TX
30
40
50
60
70
80
% born in state of residence
twoway scatter ownhome borninstate, mlabel(stateab) mlabvpos(pos)
There are a few markers whose
corresponding marker labels overlap
each other. The mlabvpos() (marker
label variable position) option allows us
to assign a different marker label
position for each observation via a
variable in the data file. The variable
pos has a value of 3, except for states
AL , MS , AR ,and LA , where pos is 9, 12,
12, and 6, respectively. Note how the
markers are in the 3 o'clock position,
except for AL , MS , AR ,and LA ,which
are in the 9, 12, 12, and 6 o'clock
positions, respectively.
Uses allstates3.dta & scheme vg s2c
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.
WV
MS
DE
AL
AR
SC
TN
KY
OK
NC
FL
MD
VA
LA
GA
TX
30
40
50
60
70
80
% born in state of residence
Search WWH ::




Custom Search