I have my out foder:
global MY_OUT "C:\Users\out"
and the loop as below:
foreach y of varlist reer cpi gdpgr {
local graphtitle : var lab `y'
twoway (line c tp,title("`graphtitle'") legend(off) lwidth(0.25 ) ///
lcolor(black) lpattern(solid))(line trq tp,lwidth(0.4) lcolor(black) ///
lpattern(solid))(line l tp,lwidth(0.25 ) ///
lcolor(black) lpattern(longdash)) (line u tp ,lwidth(0.25 ) lcolor(black) ///
lpattern(longdash) ///
xlabel(-3 "t-3" -2 "t-2" -1 "t-1" 0 "t" 1 "t+1" 2 "t+2" 3 "t+3") ///
yline(0,lwidth(0.25 ) lcolor(black) lpattern(shortdash)) saving(`y' , replace ))
drop tp c trq l u
local graphnames `graphnames' `y'
}
I was using something like
saving($MY_OUT\`y' , replace ) but it still saves the graphs in my do folder and not in my out folder.
0 Response to How to save graphs from loop in particular folder
Post a Comment