Guest User

Untitled

a guest
Oct 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import mpl_toolkits.mplot3d as a3
  2. import matplotlib.pylab as plt
  3. import numpy as np
  4.  
  5. fig = plt.figure()
  6. ax = a3.Axes3D(fig)
  7.  
  8. # create an orizontal plane
  9. corners = [[0,0,0],[0,5,0],[5,5,0],[5,0,0]]
  10. tri = a3.art3d.Poly3DCollection([corners], alpha=1)
  11. tri.set_color('w')
  12. tri.set_edgecolor('k')
  13. ax.add_collection3d(tri)
  14.  
  15. # plot a vector
  16. ax.plot([2,2],[2,2],[0,4], c = 'r')
  17.  
  18. # plot some points
  19. ax.scatter([1,3],[1,3],[1,3], c = 'r')
  20.  
  21. ax.set_xlim([0, 5.0])
  22. ax.set_ylim([0, 5.0])
  23. ax.set_zlim([0, 2.5]);
  24.  
  25. plt.show()
Add Comment
Please, Sign In to add comment