Facebook
From Sharp Duck, 5 Days ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 41
  1. import matplotlib.pyplot as plt
  2. from mpl_toolkits.mplot3d import Axes3D
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5.  
  6. fig = plt.figure()
  7. ax = fig.gca(projection='3d')
  8. X = np.arange(1, 8, np.pi)
  9. Y = [-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8]
  10. X, Y = np.meshgrid(X, Y)
  11. Z = ((np.cos(Y)+np.sin(Y))/(Y))
  12. surf = ax.plot_surface(X, Y, Z,linewidth=0, antialiased=False)
  13.  
  14. fig.suptitle('Wykres funkcji f(x,y)=(np.cos(X)+3)/((X**2)+4)', fontsize=10, fontweight='bold')
  15. ax.set_xlabel('X')
  16. ax.set_ylabel('Y')
  17. ax.set_zlabel('Z')
  18. legend = ax.legend(loc='upper left', shadow=True, fontsize='large')
  19. plt.show()
  20.