三维线框在一个方向上绘制

证明将rstride或cstride设置为0会导致在相应方向上不生成导线。

三维线框在一个方向上绘制示例

  1. from mpl_toolkits.mplot3d import axes3d
  2. import matplotlib.pyplot as plt
  3. fig, [ax1, ax2] = plt.subplots(2, 1, figsize=(8, 12), subplot_kw={'projection': '3d'})
  4. # Get the test data
  5. X, Y, Z = axes3d.get_test_data(0.05)
  6. # Give the first plot only wireframes of the type y = c
  7. ax1.plot_wireframe(X, Y, Z, rstride=10, cstride=0)
  8. ax1.set_title("Column (x) stride set to 0")
  9. # Give the second plot only wireframes of the type x = c
  10. ax2.plot_wireframe(X, Y, Z, rstride=0, cstride=10)
  11. ax2.set_title("Row (y) stride set to 0")
  12. plt.tight_layout()
  13. plt.show()

下载这个示例