I want to draw a vertical plane defined by
5 = x + y
in a 3D figure, using Matplotlib.
I had a look at this and this, but no chance. I also found mpl_toolkits.mplot3d.art3d.line_2d_to_3d
at this link, which says
Convert a 2D line to 3D
Looked promising to me, but I could not figure out how to use it.
Now, how would you modify the following code to achieve my objective?
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
xs = np.linspace(0, 10, 100)
ys = np.linspace(0, 10, 100)
X, Y = np.meshgrid(xs, ys)
Z # ?????????
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X, Y, Z)
plt.show()
Thanks for you help in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…