Graphics Reference
In-Depth Information
twoway scatter propval100 rent700 popden, legend(position(1))
Consider this scatterplot. We have
added a legend() option to make the
legend display in the one o'clock
position on the graph, putting the
legend in the top right corner.
Uses allstates.dta & scheme vg s2c
% homes cost $100K+
% rents $700+/mo
0
2000
4000
6000
8000
10000
Pop/10 sq. miles
graph bar propval100 rent700, over(nsw) legend(position(1))
Here, we use the graph bar command,
which is a completely different
command from the previous one. Even
though the graphs are different, the
legend() option we supply is the same
and has the same effect. Many (but not
all) options function in this way,
sharing a common syntax and having
common effects.
Uses allstates.dta & scheme vg s2c
mean of propval100
mean of rent700
North
South
West
graph matrix propval100 rent700 popden, legend(position(1))
Contrast this example with the previous
two. The graph matrix command does
not support the legend() option
because this graph does not need or
produce legends. In the Matrix (95)
chapter, for example, there are no
references to legends, an indication that
this is not a relevant option for this
kind of graph. Note that, even though
we included this additional irrelevant
option, Stata ignored it and produced
an appropriate graph anyway.
Uses allstates.dta & scheme vg s2c
0
20
40
100
% homes
cost
$100K+
50
0
40
% rents
$700+/mo
20
0
10000
Pop/10
sq.
miles
5000
0
0
50
100
0
5000
10000
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