Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mpl_toolkits.mplot3d as a3
- import matplotlib.pylab as plt
- import numpy as np
- fig = plt.figure()
- ax = a3.Axes3D(fig)
- # create an orizontal plane
- corners = [[0,0,0],[0,5,0],[5,5,0],[5,0,0]]
- tri = a3.art3d.Poly3DCollection([corners], alpha=1)
- tri.set_color('w')
- tri.set_edgecolor('k')
- ax.add_collection3d(tri)
- # plot a vector
- ax.plot([2,2],[2,2],[0,4], c = 'r')
- # plot some points
- ax.scatter([1,3],[1,3],[1,3], c = 'r')
- ax.set_xlim([0, 5.0])
- ax.set_ylim([0, 5.0])
- ax.set_zlim([0, 2.5]);
- plt.show()
Add Comment
Please, Sign In to add comment