import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

point  = np.array([1, 2, 3])
normal = np.array([1, 1, 2])

# a plane is a*x+b*y+c*z+d=0
# [a,b,c] is the normal. Thus, we have to calculate
# d and we're set
d = -point.dot(normal)

# create x,y
xx, yy = np.meshgrid(range(10), range(10))

# calculate corresponding z
# a*x+b*y+c*z+d=0 可的 z = -(ax+by+d)/c
z = (-normal[0] * xx - normal[1] * yy - d) * 1. /normal[2]
fig = plt.figure()
# plot the surface
plt3d = fig.add_axes(Axes3D(fig))
 
plt3d.plot_surface(xx, yy, z)
plt.show()