This example is similar to example 1, but adds the capability to change the range by using buttons below the graph.