Graphing examples

2-Dimensions

Function

Plot[Sin[(x^2)], {x, -2 π, 2  π}]

⁃Graphics⁃

Multiple functions

Plot[{Sin[x], (x^2)}, {x, -π, 2  π}]

Parametric

ParametricPlot[{Cos[5 t], Sin[3  t]}, {t, 0, 2  π}, 
      AspectRatio -> 1]

Implicit - method 1

ContourPlot[(x^2) - (y^2) - 1, {x, -5, 5}, {y, -5, 5}, 
      Contours -> {0}, ContourShading -> False]

Implicit - method 2

<< Graphics`ImplicitPlot`

ImplicitPlot[(x^2) - (y^2) == 1, {x, -5, 5}]

Polar

<< Graphics`

PolarPlot[{(4/(2 + Cos[θ])), 4  Cos[θ] - 2}, {θ, 
        0, 2  π}]

⁃Graphics⁃

Vector fields

<< Graphics`PlotField`

PlotVectorField[{Sin[x], Cos[y]}, {x, 0, Pi}, {y, 0, Pi}]

3-Dimensions

Function

<< RealTime3D`

Plot3D[(x^2) + (y^2), {x, -5, 5}, {y, -5, 5}]

Multiple functions

<< Default3D`

graph1 = Plot3D[(x^2) + (y^2), {x, -5, 5}, {y, -5, 5}]

graph2 = 
      Plot3D[(x^2) - (y^2) + 10, {x, -5, 5}, {y, -5, 5}]

Show[{graph1, graph2}]

Show[{graph1, graph2}, 
      ViewPoint -> {-0.859,  -1.108,  0.613}]

Parametric

<< RealTime3D`

ParametricPlot3D[{s Sin[t],  s Cos[t], s  }, {s, -12, 12}, {t, 
        0, 2  π}]

Implicit

<< Realtime3D`

ContourPlot3D[
      (x^3) + (y^3) + (z^3) + 1 - (((x + y + z + 1))^3), {x, -2, 
        2}, {y, -2, 2}, {z, -2, 2}, PlotPoints -> 6]

Level curves

ContourPlot[Sin[x] Sin[y], {x, -2, 2}, {y, -2, 2}]

ContourPlot[Sin[x] Sin[y], {x, -2, 2}, {y, -2, 2}, 
      ContourShading -> False]

Level surfaces

<< Graphics`ContourPlot3D`

ContourPlot3D[
      Cos[Sqrt[x^2 + y^2 + z^2]], {x, - .5, 2}, {y, -2, 
        2}, {z, -2, 2}, Contours -> {0. , 0.4, 0.8}]

ContourPlot3D[
      Cos[Sqrt[x^2 + y^2 + z^2]], {x, - .5, 2}, {y, -2, 
        2}, {z, -2, 2}, Contours -> {0. , 0.4, 0.8}, 
      PlotPoints -> 6]

Vector fields

<< Graphics`PlotField3D`

<< RealTime3D`

PlotVectorField3D[{x, y, z}, {x, 0, 2}, {y, 0, 2}, {z, 0, 
        2}]

PlotVectorField3D[{x, y, z}, {x, 0, 2}, {y, 0, 2}, {z, 0, 2}, 
      VectorHeads -> True]

Spherical coordinates

<< Graphics`ParametricPlot3D`

<< RealTime3D`

SphericalPlot3D[θ, {ϕ, 0.5, π}, {θ, 0, 
        4  π}]

Cylindrical coordinates

<< Graphics`ParametricPlot3D`

<< RealTime3D`

CylindricalPlot3D[
      0.3  r θ, {θ, 0, 6  π}, {r, 0, 12}]

Curves in 3-D

<< RealTime3D`

ParametricPlot3D[{Sin[2  t], Cos[3  t], Cos[2  t]}, {t, 0, 
        2  π}]

Animation

Basic animation

Table[Plot[Sin[n x], {x, 0, 2 Pi}], {n, 1, 6, 1}]

Show[GraphicsArray[Partition[%, 3]]]

Animate tangent line along a curve

f[x_] := Sin[x]

xMin = -2 π; xMax = 2  π;

yMin = -1.5; yMax = 1.5;

frames = 12;

Table[
      Plot[{f[x], f'[
                xMin + t (((xMax - xMin))/frames)] (x - (xMin + 
                      t (((xMax - xMin))/frames))) + 
            f[xMin + t (((xMax - xMin))/frames)]}, {x, xMin, xMax}, 
        PlotRange -> {yMin, yMax}], {t, 1, frames}]

Show[GraphicsArray[Partition[%, 3]]]