Statalist


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

st: How to force stata to use different line pattern


From   Abdel Rahmen El Lahga <rahmen.lahga@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: How to force stata to use different line pattern
Date   Mon, 1 Feb 2010 23:13:07 +0100

I'm writing a new command that produce a graph and allow the use of by() option.
However, given that I can not determine a priori the number of
mofalities  of the by(variable)  I can not set the line pattern of the
outputed graph.
My question is how to force stata to use different line pattern in the
graph. Below you find a piece of my ado file

local listvar "`listvar' `newvar`i''"   // set the list of variable
used in the graph

** and here is my graph command

if "`graph'" != ""  {
			qui gen `p'=`pvar'
				label variable `p' "uniform distribution curve"
				gen byte `pe'=1
				label variable `pe' "perfect equality line"
				if `nv' > 1 {
					local yti `"yti("`curvelabel' `varlist' (by `by')")"'
				}
				twoway scatter `listvar' `pvar' if `touse' , ///
				ms(i ..) c(l ..) `yti' legend(col(1)) `options'  || line `pe'
`pvar' , lpattern(dot) || line `p' `p' , lpattern(dash_dot)
		}

-- 
AbdelRahmen El Lahga
Assistant Professor
University of Tunis
*
*   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