*! NJC 1.1.0 23 August 1999
program define mnthplot
    version 6.0
    syntax varlist(min=2) [if] [in] [aweight fweight iweight] [, Pad(int 0) * ]
    tokenize `varlist'
    local nvars: word count `varlist'
    if `pad' > 12 | `pad' < 0 {
	    di in r "pad length `pad' not supported"
	    exit 198
    }

    preserve
    tempvar touse
    mark `touse' `if' `in'
    markout `touse' ``nvars''
    qui keep if `touse'

    local np1 = _N + 1
    local xvar ``nvars''
    qui expand 1 + (`xvar' <= `pad')
    qui if _N >= `np1' { /* need to check that expansion took place */
        replace `xvar' = `xvar' + 12 in `np1'/l
    }
    local xvarlbl : value label `xvar'
    if "`xvarlbl'" != "" {
    	local i = 1
	while `i' <= `pad' {
		local val = 12 + `i'
		local lbl : label `xvarlbl' `i'
		label def `xvarlbl' `val' "`lbl'", modify
		local i = `i' + 1
	}
    }

    graph `varlist' [`weight' `exp'], `options'
end