Facebook
From Aqua Mockingjay, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 242
  1. __author__ = 'local'
  2.  
  3.  
  4. import matplotlib.pyplot as plt
  5. import numpy as np
  6. fig = plt.figure()
  7. ax = fig.add_subplot(111)
  8. x=[-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
  9. y=[]
  10.  
  11.  
  12. for liczba in x:
  13.     y+=[(np.cos(liczba)+3)/((liczba**2)+4)]
  14.  
  15.  
  16.  
  17. fig.suptitle('Wykres funkcji', fontsize=14, fontweight='bold')
  18. ax.set_xlabel('oś x')
  19. ax.set_ylabel('oś y')
  20.  
  21.  
  22.  
  23. plt.plot(x,y,'r')
  24.  
  25. plt.show()