Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from mpl_toolkits.mplot3d import Axes3D
- %matplotlib notebook
- import matplotlib.pyplot as plt
- import numpy as np
- #ok
- fig = plt.figure()
- ax = fig.add_subplot(111, projection='3d')
- '''Prepare the 2D domain: x from -5 to 5 and y from -5 to 5'''
- x,y = np.meshgrid(np.linspace(-5,5,21),np.linspace(-5,5,21))
- t = np.linspace(-5,5,21)
- x = 3*t
- y = 1+t
- z = 2-t
- ax.plot (x,y,z)
- '''z for the first plane'''
- x,y = np.meshgrid(np.linspace(-5,5,21),np.linspace(-5,5,21))
- z = -16-8*x-8*y
- ax.plot_wireframe(x,y,z,color='red')
- ax.set_xlabel('x')
- ax.set_ylabel('y')
- ax.set_zlabel('z')
- ax.set_title('Plot of 2 Planes')
- ax.view_init(-99,37)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement