Here is an answer that lets one plot a plane using matplotlib
, but if one uses the vector [1, 0, 0]
, nothing gets plotted! This makes sense, because of the way the code is set up (meshgrid is on X-Y plane, and then Z points determine the surface.
So, how can I plot the X = 0 plane using matplotlib?
This is less generic than the example that you linked, but it does the trick:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
yy, zz = np.meshgrid(range(2), range(2))
xx = yy*0
ax = plt.subplot(projection='3d')
ax.plot_surface(xx, yy, zz)
plt.show()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With