In [1]:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib

#borrowed from http://stackoverflow.com/questions/3461869/plot-a-plane-based-on-a-normal-vector-and-a-point-in-matlab-or-matplotlib


Using matplotlib backend: Qt4Agg

In [2]:
theta =np.pi
point  = np.array([0, 0, 0])
normal = np.array([np.sin(theta), 0, np.cos(theta)])
d = -point.dot(normal)

xx, yy = np.meshgrid(range(-10,10), range(-10,10))

#calculate z as a real instead of an int
z = (-normal[0] * xx - normal[1] * yy - d) * 1. /normal[2]

In [8]:
fig = plt.figure().gca(projection='3d')
fig.plot_surface(xx, yy, z)
fig.set_xlabel('X Label'), fig.set_ylabel('Y Label'), fig.set_zlabel('Z Label')
plt.show()

In [ ]:


In [ ]:


In [ ]:


In [ ]: