Dear all,
I need to create multiple graphs based on different variables. To do so, I have created a loop, where the title of the graph is taken from the variable label. I am wondering if there is any way to do something similar but with notes and captions. That is, to take variable notes and use them to add a caption in the graph. Not all my variables have notes, but some of them do. Here is the code:
So, the idea would be to fill the "caption" space with the notes taken from each variable in varlist.
Many thanks in advance.
I need to create multiple graphs based on different variables. To do so, I have created a loop, where the title of the graph is taken from the variable label. I am wondering if there is any way to do something similar but with notes and captions. That is, to take variable notes and use them to add a caption in the graph. Not all my variables have notes, but some of them do. Here is the code:
Code:
foreach i of varlist ncittop100_1_t_rel - ppcittop200_10_t_rel { local label: variable label `i' twoway (tsline `i'_idex1_ if !missing(idex1) & time>=-5, lcolor(red) lwidth(medthick) lpattern(solid) connect(direct))/* */ (tsline `i'_idex2_ if !missing(idex2) & time>=-5, lcolor(blue) lwidth(medthick) lpattern(solid) connect(direct)),/* */ ytitle(difference within reference group) scheme(s1manual) legend(off) tline(-0.5, lpattern(dash) lcolor(gs6)) tline(0.5, lpattern(dash) lcolor(gs6)) /* */ legend (on order(1 "All " 2 "Sample") cols(1) all size(med)) /* */ yline(0, lwidth(vthin) lpattern(dash) lcolor(gs12)) /* */ title("`label'", span) /* */ caption("---------", size(small)) graph export `i'_.eps, as(eps) preview(off) or(portrait) mag(200) replace }
Many thanks in advance.
Comment