Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Changing plot background color


From   Friedrich Huebler <huebler@rocketmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: Changing plot background color
Date   Wed, 24 Mar 2004 08:39:44 -0800 (PST)

Richard,

In addition to what Dimitriy suggested you can set the background
color to white. In some cases, the graph region does not completely
cover the area of the graph. At the outer border of the graph you may
then see fine lines in the background color that is specified in the
scheme that you use (ltbluishgray for s2color and gs15 for s2mono,
for example). You can avoid these lines by adding the -bgcolor()-
option to the graph command. Compare the two graphs created below:

. sysuse auto, clear
. set scheme s2color
. scatter mpg weight, graphregion(color(white))
. scatter mpg weight, graphregion(color(white)) bgcolor(white)

On my computer (Stata 8.2, Windows XP), the first graph has thin blue
lines at the top and right margins, the second does not.

Friedrich Huebler

--- "Dimitriy V. Masterov" <dvmaster@lily.src.uchicago.edu> wrote:
> Try this line in your command for a snow-white background:
> 
> plotregion(fcolor(white)) graphregion(fcolor(white))
> 
> 
> Here is an example of a command that I might use:
> 
> *********************************************************
> graph bar (asis) NCDSab BCSab NCDSinc BCSinc if sex==`sex',
> by(level,
> title("Figure 1" "Marginal Effect of Cognitive Ability and Log
> Family"
> "Income on Final Schooling Attainment")
> subtitle("``sex'' from NCDS and BCS, Age 10-11")
> note("Based on ordered probit estimates of the probability of
> achieving a
> given level of schooling. Marginal"
> "effects are calculated controlling for family and socio-economic
> characteristics"
> "Source: Galindo-Rueda and Vignoles (2003).", span size(small) ))
> subtitle(, pos(12) ring(1) prefix nobexpand nobox span size(small))
> ytitle(Probability)
> legend(cols(2) size(small) symxsize(2) symysize(3) span )
> lintensity(500) blabel(bar, size(vsmall) format(%9.3f))
> plotregion(fcolor(white)) graphregion(fcolor(white))
> ;
> *********************************************************
> 
> 
> DVM
> On Tue, 23 Mar 2004, Richard Hoskins wrote:
> 
> > I have some plots from Stata, latest version, but there is a gray
> > background. How can I remove the grey background so I can use
> them for
> > publication?
> >
> > Thanks
> >
> > New to STATA,
> >
> > R Hoskins
> > WA State DOH
> >
>
_______________________________________________________________________________
> Dimitriy V. Masterov
> 
> Work:
> Center for Social Program Evaluation
> 1155 East 60th St. Room 038
> Chicago, IL 60637
> Work: (773)256-6005
> Fax: (773)256-6313
> 
> Home:
> 1312 East 53rd St., Apt.309
> Chicago, IL 60615
> Mobile: (773)220-2760

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index