This notebook contains the examples shown in class on November 12, 2015. It can be used as a template for plotting the graph of a function of two variables in a three-dimensional coordinate system.

We make use of sympy plotting.

In [1]:
from sympy import init_session
from sympy.plotting import *
init_session()
IPython console for SymPy 0.7.6 (Python 2.7.8-64-bit) (ground types: gmpy)

These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> init_printing()

Documentation can be found at http://www.sympy.org

This is the function on one version of the quiz:

In [2]:
plot3d(exp(-x**2-y**2),(x,-2,2),(y,-2,2))
Out[2]:
<sympy.plotting.plot.Plot at 0x7f837295ed90>

And the function from the other version of the quiz:

In [3]:
plot3d(1/(1+x**2+y**2),(x,-2,2),(y,-2,2))
Out[3]:
<sympy.plotting.plot.Plot at 0x7f83725d4190>

And finally the function from the example used in class on Tuesday, November 10.

In [4]:
plot3d(x/(1+x**2+y**2),(x,-5,5),(y,-5,5))
Out[4]:
<sympy.plotting.plot.Plot at 0x7f8372169950>