Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: graph rarea optical illusion or coding error?


From   philippe van kerm <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: graph rarea optical illusion or coding error?
Date   Wed, 11 May 2011 12:44:25 +0000

Nice picture, Uli!

My own bet would be that the lines are visible on your graph because the area and lines are drawn in the same color but not the same intensity. To me it looks like adding the -fintensity(100)- option works ok:

 forv i = 15(-1)1 {
 	  local rarea `rarea'	       ///
 	  || rarea ub`i' lb`i' rep78,  ///
 	  lcolor(gs`i') fcolor(gs`i') fintensity(100) lwidth(none) sort
 }

Philippe


> -----Message d'origine-----
> De : [email protected] [mailto:owner-
> [email protected]] De la part de Ulrich Kohler
> Envoyé : Wednesday, May 11, 2011 2:04 PM
> À : statalist
> Objet : st: graph rarea optical illusion or coding error?
> 
> Listers,
> 
> I try to create a figure of shaded areas for 5%, 10%, 15% ... 95%
> confidence intervals. The resulting areas seem to have a lines around
> the areas that are darker than both neighbouring areas. Is it possible
> to get rid of this, or is this just an optical illusion?
> 
> Here is a minimal example of my code. Note that I tried various
> settings
> for -lwidht()- , -lcolor()-, -fintensity()-. Most surprisingly
> -lcolor(none)- removes areas completely, btw.
> 
> -----------------------------------------------------illusion.do
> sysuse auto, clear
> 
> collapse (mean) mean=mpg (semean) se=mpg, by(rep78)
> 
> local pen 15
> forv alpha = .05(.06).95 {
> 	gen ub`pen' = mean + invnormal(1-`alpha'/2)*se
> 	di "gen ub`pen' = mean + `=invnormal(1-`alpha'/2)'*se"
> 	gen lb`pen' = mean - invnormal(1-`alpha'/2)*se
> 	local pen = `pen'-1
> }
> 
> forv i = 15(-1)1 {
> 	  local rarea `rarea'	       ///
> 	  || rarea ub`i' lb`i' rep78,  ///
> 	  lcolor(gs`i') fcolor(gs`i') lwidth(none) sort
> }
> 
> graph twoway `rarea' || , legend(off)
> 
> exit
> -------------------------------------------------------------------
> 
> 
> 
> 
> 
> 
> *
> *   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/

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index