The DispGraph command displays the graph screen, along with everything drawn or graphed on it.
In many cases, this doesn't need to be done explicitly: commands from the 2nd DRAW menu, as well as many other graph screen commands, will display the graph screen automatically when they are used. Mainly, it's used for displaying the graphs of equations or plots in a program — you would define the variable in question, then use DispGraph to graph it. For example:
DispGraph can also be used to update the graph screen, even if it's already being displayed. For example, changing the value of a plot or equation variable doesn't update the graph immediately. Consider this program:
:0→I :"Isin(X)"→Y1 :DispGraph :For(I,1,10) :End
At first, it graphs the equation Y=Isin(X) with I=0. Since after that, I is cycled from 1 to 10, and we are on the graph screen, it would be reasonable if this made the program display the graphs of Y=1sin(X) through Y=10sin(X). Unfortunately, this isn't the case: though the parameter I changes, the graph screen isn't updated. If, on the other hand, we change the program:
:0→I :"Isin(X)"→Y1 :DispGraph :For(I,1,10) :DispGraph :End
Now the DispGraph inside the loop ensures that the graph screen is updated every time, and the program will correctly display all eleven graphs.
- ERR:INVALID occurs if this statement is used outside a program.