Graphics Reference
In-Depth Information
twoway scatter ownhome borninstate [aweight=propval100],
msymbol(oh) msize(small)
Even if we weight the size of the
markers using aweight , we can still
control the general size of the markers.
Here, we make all markers smaller
using the msize(small) option. The
markers are smaller than they were
previously but are still sized according
to the value of propval100 .
Uses allstates.dta & scheme vg s1m
20
40
60
80
% born in state of residence
twoway scatter ownhome borninstate [aweight=propval100],
msymbol(oh) msize(large) mlabel(stateab)
We might try to even graph a fourth
variable in the plot by using the
mlabel() (marker label) option. Here,
we try to use the mlabel(stateab)
option to label each marker with the
abbreviation of the state. However,
note that when we add the mlabel()
option, the weights no longer affect the
size of the markers. See the following
example for a solution to this.
Uses allstates.dta & scheme vg s1m
MN
MS
ME
MI
WV
WI
P A
DE
I A
VT
VA
IN
AL
N H
ID
UT
A R
KS
SC SD
M O
OK
K Y
LA
WY
TN
NC N D
N E
OH
N M
C T
IL
FL
NJ
MD
MT
AZ
GA
CO
O R
WA
TX
MA
RI
NY
NV
CA
AK
HI
DC
20
40
60
80
% born in state of residence
twoway (scatter ownhome borninstate [aweight=propval100],
msymbol(oh) msize(large))
(scatter ownhome borninstate, mlabel(stateab) msymbol(i) mlabpos(center) )
We can solve the problem from the
previous example by overlaying a
scatterplot that has the symbols
weighted by propval100 with a
scatterplot that shows just the marker
labels. The second scatterplot uses the
mlabel(stateab) msymbol(i)
mlabpos(center) options to label the
markers with the state abbreviation.
See Options : Marker labels (247) for
more details.
Uses allstates.dta & scheme vg s1m
MN
MS
ME
WV
WI
MI
P A
DE
VT
VA
IA
IN
AL
N H
ID
UT
A R
KS
SC SD
OK
MO
K Y LA
WY
TN
NC N D
N M
NE
OH
FL
C T
IL
NJ
MT
MD
AZ
G A
CO
O R
WA
TX
MA
RI
NY
NV
CA
AK
HI
DC
20
40
60
80
% born in state of residence
% who own home
% who own home
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