Plot is a simple two-dimensional plotting function in Mathematica. Plot takes two arguments when it is called and these two arguments can contain numerous parts. This may not sound so simple, but once you see how it works it is very straight forward.
The first argument to Plot is the function or functions to be plotted. The second argument is a list containing a variable to be used a the range over which the variable is to be plotted.
Plot[Cos[x], {x, -2Pi, 2Pi}]
The line shown above will plot a simple cosine curve from -2pi
to 2pi. The function,
The important points to remember about Plot is that it is passed two arguments separated by a comma. The arguments themselves can contain numerous parts which would then be enclosed in brackets and each separated by a comma.
Numerous functions can be plotted at the same time with one call to Plot. These functions must use the same variable and the same range though.
Plot[{Sin[x], Cos[x]}, {x, -2Pi, 2Pi}]
This line will plot a sine and cosine function from -2pi to 2pi.
Notice the both
Plot3D works in the same way that Plot does except two variables are used and the function is called with a minimum of three arguments. These arguments consist of the function or functions to be plotted, a variable and its range, and a second variable and its range. Again these arguments are separated by commas.
Plot3D[Sin[x]+Cos[y], {x, 0, 4Pi}, {y, 0, 4Pi}]
This equation will plot a mountainous surface that resembles an egg carton. Both of the axises will have a range from to 4pi.
Plot3D is able to accept more then three arguments. These arguments generally handle the appearance of the final plot of the describe surface and the way in which it is viewed.
Plot3D[Sin[x+Sin[y]], {x, 0, 4Pi}, {y, 0, 4Pi}, PlotPoints->30]
Plot3D[Sin[x+Sin[y]], {x, 0, 4Pi}, {y, 0, 4Pi}, PlotPoints->50, Mesh->False]
The lines above describe a 3 dimensional plot that has been
adjusted slightly for viewing purposes. In the first line
The example shown above have been taken from Exploring Mathematics with Mathematica and have been intended to give a basic beginning to plotting with Mathematica. The references contain some books that are recommended for people who wish to learn the more advanced features of Mathematica.