{smcl} {* 29Jun2008}{...} {cmd:help wfeggraphs} {hline} {title:Title} {p2colset 5 12 24 2}{...} {p2col:{hi:Graph examples}}{p_end} {title:List of examples} {p2colset 5 12 24 2}{...} {p2col:1. Creating a graph from data in a matrix.}{p_end} {p2col:2. Scatterplots for all pairs of variables.}{p_end} {p2col:3. Adding provenance captions to a graph.}{p_end} {title:1. Creating a graph from data in a matrix} svmat stats, names(col) // use column names to name varaibles twoway (connected bic root, msymbol(circle)), /// ytitle(BIC statistic) ylabel(1700(10)1750) /// xtitle(Root transformation of articles) xlabel(1(1)9) /// caption("wf7-matrix-plot.do \ jsl 2008-04-11",size(vsmall)) {title:2. Scatterplots for all pairs of variables} // graph matrix creates a single graph graph matrix job phd ment art cit fem fel, /// jitter(3) half msymbol(circle_hollow) // the double loop creates graphs for each pair of variables local varlist "phd job ment art cit fem fel" local nvars : word count `varlist' forvalues y_varnum = 1/`nvars' { local y_var : word `y_varnum' of `varlist' local y_lbl : variable label `y_var' label var `y_var' "`y_var': `y_lbl'" local x_start = `y_varnum' + 1 forvalues x_varnum = `x_start'/`nvars' { local x_var : word `x_varnum' of `varlist' local x_lbl : variable label `x_var' label var `x_var' "`x_var': `x_lbl'" scatter `y_var' `x_var', msymbol(circle_hollow) jitter(8) /// ylabel(, grid) xlabel(, grid) aspectratio(1) graph export wf6-review-jobphd-`y_var'-`x_var'.png, replace label var `x_var' "`x_lbl'" } } {title:3. Adding provenance captions to graphs} local cap "wf7-caption.do \ jsl 2008-04-09" twoway (line art_root2 art_root3 art_root4 art_root5 articles, /// lwidth(medium)), ytitle(Number of Publications to the k-th Root) /// yscale(range(0 8.)) legend(pos(11) rows(4) ring(0)) /// caption(`cap', size(vsmall)) {p2colset 5 12 12 2} {title:Also see} {helpb wf} INCLUDE help wf_footer