Graphics Reference
In-Depth Information
twoway scatter propval100 rent700 popden
Here, we show two
-variables,
propval100 and rent700 , graphed
against population density, popden .
Note that Stata has created a legend,
helping us see which symbols
correspond to which variables. We can
use the legend() option to customize
it.
Uses allstates.dta & scheme vg s2c
y
0
2000
4000
6000
8000
10000
Pop/10 sq. miles
% homes cost $100K+
% rents $700+/mo
twoway scatter propval100 rent700 popden, legend(cols(1))
Using the legend(cols(1)) option, we
make the legend display in a single
column. Note that we did not use a
comma because, with the legend()
option, there is no natural default
argument. If we had included a comma
within the legend() option, Stata
would have reported this as an error.
Uses allstates.dta & scheme vg s2c
0
2000
4000
6000
8000
10000
Pop/10 sq. miles
% homes cost $100K+
% rents $700+/mo
twoway scatter propval100 rent700 popden,
legend(cols(1) label(1 "Property Value") )
This example adds another option
within the legend() option, label() ,
which changes the label for the first
variable.
Uses allstates.dta & scheme vg s2c
0
2000
4000
6000
8000
10000
Pop/10 sq. miles
Property Value
% rents $700+/mo
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