[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: stata 9 how to change background color in twoway line SUMMARY OF SOLUTIONS
Many thanks to Svend Juul, AbdelRahmen El Lahga, and especially Scott
Merryman for sharing their experience and offering useful advice. Using
their suggestions I obtained nice graphs and thought I would summarize my
experience for future inexperienced users like me.
Problem: I was trying to graph multiple countries on the same graph but
kept getting shading around the graph and subtitles. The shading had to be
removed for publication, but I could not figure out how to do it.
Solutions: if you graph the following twoway line log_rgdp year if
iso1<16, ytitle("log_rgdp") xtitle("year") by((country), note("") cols(3))
ylabel(7.4(1)10.40, gmax angle (horizontal)) xlabel(#5)
1. Using STATA schemes like s1mono, s1color, etc (schemes that come up
under schemes intro) without region_options to control for color, schemes
that starts with s2 result in shading around the graph and sub-titles.
Schemes that start with s1 will remove shading around the graph but still
give shading around subtitles (thanks to AbdelRahmen El Lahga for
suggesting this option).
2. To remove shading completely from subtitles and around the graphs, set
scheme lean1 or lean2. Note that these two schemes look slightly different
but completely remove any color from the graphs. To find lean schemes type
"findit lean scheme", Stata does not list these lean schemes under schemes
intro (thanks to Svend Juul for pointing the lean schemes option).
3. You can also control the shading even under s2color, etc. schemes by
specifying region_options. For example, even when my scheme is set to
s2color, typing the following produces a graph on a plain white background
with no shading around subtitles: twoway line log_rgdp year if iso1<16,
clcolor (black) bfcolor(white) ytitle("log_rgdp") xtitle("year")
by((country), graphregion(color(white)) note("") cols(3)) subtitle(,
fcolor(white) lcolor(white)) ylabel(7.4(1)10.40, gmax angle
(horizontal)) xlabel(#5) (thanks to Scott Merryman for correcting my
Hope this helps others.
* For searches and help try: