Facebook
From Edgy Duck, 2 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 84
  1. import matplotlib.pyplot as plt
  2. import numpy as np
  3.  
  4.  
  5. fig = plt.figure()
  6. ax = fig.add_subplot(111)
  7. d=[-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
  8. y=[]
  9.  
  10. d1=[-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8]
  11. y1=[]
  12.  
  13. for x in d:
  14.     y+=[(x)/(x**2+x+5)]
  15.  
  16. for x in d1:
  17.     y1+=[((np.cos(x)+np.sin(x))/(x))]
  18.  
  19.  
  20.  
  21.  
  22. ax.plot(d,y,'r')
  23. ax.plot(d1,y1,'g')
  24. ax.legend(['funkcja1','funkcja2'])
  25. fig.suptitle('Wykreys funkcji xXx', fontsize=15, fontweight='bold')
  26. ax.set_xlabel('oĹ› x')
  27. ax.set_ylabel('oĹ› y')
  28. plt.show()
  29.