//@code objref g //Creates an object reference "g" which can be made to //point to any object. g = new Graph() //Assigns "g" the role of pointing to a Graph instance //created from the Graph class, and produces //a graph window with x and y axes on the //screen. g.size(0, 10, -1, 1) // specify coordinate system for the canvas drawing area // numbers refer to xmin, xmax, ymin, ymax respectively g.beginline() //The next g.line command will move the drawing pen // to the indicated point without drawing anything for(x=0; x<=10; x=x+0.1){ //States that x values to be plotted //will go from 0 to 10 in increments //of 0.1. g.line(x, sin(x)) //States that the y values on the plot //will be the sin of the x values. } g.flush() //Actually draws the plot on the graph in the window.