2 import iam_sympy_example
4 from sympy
import Symbol
, Basic
5 from sample
import sample
7 def mplot3d(f
, var1
, var2
, show
=True):
9 Plot a 3d function using matplotlib/Tk.
13 warnings
.filterwarnings("ignore", "Could not match \S")
17 import matplotlib
.axes3d
as p3
19 raise ImportError("Matplotlib is required to use mplot3d.")
21 x
, y
, z
= sample(f
, var1
, var2
)
26 #ax.plot_surface(x,y,z) #seems to be a bug in matplotlib
27 ax
.plot_wireframe(x
,y
,z
)
36 if __name__
== "__main__":
41 mplot3d(x
**2-y
**2, (x
, -10.0, 10.0, 20), (y
, -10.0, 10.0, 20))
42 #mplot3d(x**2+y**2, (x, -10.0, 10.0, 20), (y, -10.0, 10.0, 20))
43 #mplot3d(sin(x)+sin(y), (x, -3.14, 3.14, 10), (y, -3.14, 3.14, 10))