*! 1.1.0 NJC 16 February 1999
* 1.0.0  NJC 22 January 1997
* avplots 2.2.2  22dec1998
* presentational differences from avplots
program define avplots2
        version 6.0
        local tsize : set textsize
        _isfit cons
        syntax [, SAVing(passthru) noDISPLAY MARgin(integer 10) /*
                */ Symbol(string) TEXTsize(int `tsize') TItle(str) * ]
                        /* Option [no]display] is out of date,
                           it does nothing.
                        */

        if "`symbol'" == "" { local symbol "s(o)" }
        else local symbol "s(`symbol')"
        if "`title'" != "" { local title `"ti(`title')"' }

        _getrhs rhs
        tokenize `rhs'
        local wasgr : set graphics
        local wasmore : set more
        capture {
                set graphics off
                set textsize `textsize'
                set more off
                while "`1'" != "" {
                        tempfile TF
                        local base `"`files'"'
                        local files `"`files' `"`TF'"'"'
                        capture avplot2 `1', saving(`"`TF'"') `symbol' `options'
                        if _rc {
                                if _rc != 399 { exit _rc }
                                local files `"`base'"'
                        }
                        mac shift
                }
                set textsize `tsize'
                set graphics `wasgr'
                set more `wasmore'
                noisily graph using `files', margin(`margin') `saving' `title'
        }
        local rc = _rc
        set textsize `tsize'
        set graphics `wasgr'
        set more `wasmore'
        error `rc'
end