I want to plot two planes and find their intersection line, but I get this result, where it's impossible to tell where they intersect, because one plane overlays the other.
A 3D projection should hide the non-visible part of the plane, how do I attain this result using matplotlib?
You can clearly see that these to plains should intersect.
Here's the code I've used to get this result
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
values = range(-10, 11)
def plotPlane(plot, normal, d, values, colorName):
# x, y, z
x, y = np.meshgrid(values, values)
z = (-normal[0] * x - normal[1] * y - d) * 1. / normal[2]
# draw plot
plot.plot_surface(x, y, z, color=colorName)
image = plt.figure().gca(projection='3d')
plotPlane(image, [3, 2, -4], 1, values, "red")
plotPlane(image, [5, -1, 2], 4, values, "gray")
plt.show()