Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Twoway graphs


From   Honorati Masanja <hmasanja@ihrdc.or.tz>
To   statalist@hsphsun2.harvard.edu
Subject   st: Twoway graphs
Date   Tue, 04 Dec 2007 15:20:09 +0300

Dear Statalisters

Apologies for bothering you with another trivial question. I would like to run code to draw the following twoway graphs on the same graph. I have an example of code I've written but this goes up to 100!

#delimit ;
twoway (line u5mr20 year,lcolor(red))
(line u5mr21 year,lcolor(red))
(line u5mr22 year,lcolor(red))
(line u5mr23 year,lcolor(red))
(line u5mr24 year,lcolor(red))
(line u5mr25 year,lcolor(red))
(line u5mr26 year,lcolor(red))
(line u5mr27 year,lcolor(red))
(line u5mr28 year,lcolor(red))
(line u5mr29 year,lcolor(red))
(line u5mr30 year,lcolor(red))
(line u5mr31 year,lcolor(red))
(line u5mr32 year,lcolor(red))
(line u5mr33 year,lcolor(red))
(line u5mr34 year,lcolor(red))
(line u5mr35 year,lcolor(red))
(line u5mr36 year,lcolor(red))
(line u5mr37 year,lcolor(red))
(line u5mr38 year,lcolor(red))
(line u5mr39 year,lcolor(red))
(line u5mr40 year,lcolor(red))
(scatter u5m2 year),
xlabel(1990(5)1920) ylabel(0(20)200);
#delimit cr


I tried the code below but I get separate graphs

foreach var of varlist u5mr20-u5mr40 {
twoway (line `var' year) (scatter u5m year,), xlabel(1990(5)1920) ylabel(0(20)200)
}


*
* 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–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index