Graphics Reference
In-Depth Information
8.9
Controlling legends
This section describes more details about using legends. Legends can be useful in a
number of situations, and this section shows how to customize them. For more information
about legend options, see [ G ] legend option . Also, for controlling the text and textbox of
the legend, see Options : Textboxes (303) and Options : Adding text (299). We will use the
vg s2c scheme.
twoway scatter ownhome propval100 urban
Legends can be created in a variety of
ways. For example, here we have two
y
-variables, ownhome and propval100 ,
on the same plot, and Stata creates a
legend labeling the different points.
The default legend, in this case, is quite
useful.
Uses allstatesdc.dta & scheme vg s2c
20
40
60
80
100
Percent urban 1990
% who own home
% homes cost $100K+
twoway (scatter ownhome urban) (lfit ownhome urban)
(qfit ownhome urban)
Legends are also created when you
overlay plots. Here, Stata adds a legend
entry for each of the overlaid plots. The
default legend, in this case, is less useful
since it does not help us differentiate
between the kinds of fit values.
Uses allstatesdc.dta & scheme vg s2c
20
40
60
80
100
Percent urban 1990
% who own home
Fitted values
Fitted values
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