Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Get rid of thin gray lines in graphs


From   Howard Lempel <HLempel@brookings.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Get rid of thin gray lines in graphs
Date   Mon, 23 Feb 2009 12:00:54 -0500

Hello all,

I'm using -graph combine- to create a figure with four graphs.  I'd like all elements of the background to be white.  I've been able to make the plot region and graph region white, but thin lines remain.  There are unwanted lines in the individual graphs and in the combined graph.  I'd like help removing these lines.  I'm using Stata 10 for windows.  The positions of the lines are described below.

1) Individual graphs
In the individual graphs have unwanted lines that form a box with its borders just to the left of the y axis title, just under my note, just to the right of the end of the x axis, and just above my title.  There is a second box that encloses this first box.

2) Combined figure
There are additional unwanted lines in the combined figure.  These are similar to the lines in the individual graphs.  There is one box with an upper boundary just above the combined title and a lower boundary just below the combined note.  There is another box that encloses the first box. 

As you'll see in my code below, I have tried setting the color of the plotregion and graphregion to white, setting the undocumented -bgcolor- option to white, and increasing the -lwidth- in my graphregion.  I've also tried adding the -fcolor(white)- option to my title, with no luck.  I've tried the suggestions in the following threads:

http://www.stata.com/statalist/archive/2006-01/msg00502.html
http://www.stata.com/statalist/archive/2003-09/msg00507.html
http://www.stata.com/statalist/archive/2004-03/msg00846.html
http://www.stata.com/statalist/archive/2004-05/msg00666.html


My code for one of the individual graphs and for the combined graph follows:
*INDIVIDUAL GRAPH (line returns added to improve readability)
twoway (hist rearnings2 if lyear==1979 & worker & `gend' [fw=fwgt], percent lwidth(medthick) width(5000) start(0) fcolor(none) lcolor(black)) ///
(hist rearnings2 if lyear==2007 & worker & `gend' [fw=fwgt], percent lwidth(vvthin) width(5000) start(0) fcolor(gs9) lcolor(gs7) barwidth(2000)) ///

,legend(label(1 "1979") label(2 "2007") symysize(*.25) symxsize(*.25) size(tiny) width(22) forcesize) xlabel(0(25000)125000) xlabel(157500 ">150,000", add custom tp(c) tl(3)) /// 

xtitle("Annual earnings ($2007)") graphregion(lcolor(none) ilcolor(none) fcolor(white) ifcolor(white) lwidth(thick)) plotregion(lcolor(none) ilcolor(none) style(none)) bgcolor(white) ///

title("Distribution of earnings in 1979, 2007") name(Fig`i'Ahist, replace)  xline(152500, lcolor(black) lpattern(shortdash)) ylabel(, angle(horizontal) nogrid) ///

note("Each bin is a $5,000 interval except the last, which includes all workers making more than $150,000", size(small))

*COMBINED GRAPH
grc1leg Fig1Ahist Fig1Bhist2_5 Fig1Chist Fig1Dhist5, name(combo1) xsize(8.4) ysize(6) title("Figure 1. All workers", size(small)) altshrink note("includes all male and female workers, age 18-64", size(tiny)) ///
	graphregion(lcolor(none) ilcolor(none) fcolor(white) ifcolor(white)) ///
	plotregion(lcolor(none) ilcolor(none) style(none)) bgcolor(white)

Thanks for your consideration.
Howie

Howie Lempel
Research Assistant
The Brookings Institution | Economic Studies
 
1775 Massachusetts Ave NW | Washington DC 20036
hlempel@brookings.edu | p: (202) 238-3576
 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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