Basic Plotting

Basic plotting functions.

This plots a graph of sin(x) as a function of x from 0 to 2π:

Plot[Sin[x],{x,0,2Pi}]

You can plot functions that have singularities. The Wolfram Language will try to choose appropriate scales:

Plot[Tan[x],{x,-3,3}]

The singularities can be omitted from the plot by using the (RefLink[Exclusions, paclet:ref/Exclusions]) option:

Plot[Tan[x],{x,-3,3},Exclusions->{-Pi/2,Pi/2}]

You can give a list of functions to plot. A different color will automatically be used for each function:

Plot[{Sin[x],Sin[2x],Sin[3x]},{x,0,2Pi}]

This finds the numerical solution to a differential equation, as discussed in "Numerical Differential Equations":

NDSolve[{y'[x]==Sin[y[x]],y[0]==1},y,{x,0,4}]

Here is a plot of the solution:

Plot[y[x]/.%,{x,0,4}]