objectvar g[20]         // max 20 graphs
ngraph = 0

proc addgraph() { local ii  // define subroutine to add a new graph
                // addgraph("variable", minvalue, maxvalue)
    ngraph = ngraph+1
    ii = ngraph-1
    g[ii] = new Graph()
    g[ii].size(tstart,tstop,$2,$3)
    g[ii].xaxis()
    g[ii].yaxis()
    g[ii].addvar($s1,1,0)
    g[ii].save_name("graphList[0].")
    graphList[0].append(g[ii])
}

proc makegraph() { local ii // define subroutine to add a new graph
                // makeraph("variable", xmin,xmax,ymin,ymax)
    ngraph = ngraph+1
    ii = ngraph-1
    g[ii] = new Graph()
    g[ii].size($2,$3,$4,$5)
    g[ii].xaxis()
    g[ii].yaxis()
    g[ii].addvar($s1,1,0)
    g[ii].save_name("graphList[0].")
    graphList[0].append(g[ii])
}