import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
x = np.arange(0,20,0.1)
print(x)
[ 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2. 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3. 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4. 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5. 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6. 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7. 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8. 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9. 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10. 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 11. 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 12. 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 13. 13.1 13.2 13.3 13.4 13.5 13.6 13.7 13.8 13.9 14. 14.1 14.2 14.3 14.4 14.5 14.6 14.7 14.8 14.9 15. 15.1 15.2 15.3 15.4 15.5 15.6 15.7 15.8 15.9 16. 16.1 16.2 16.3 16.4 16.5 16.6 16.7 16.8 16.9 17. 17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 17.9 18. 18.1 18.2 18.3 18.4 18.5 18.6 18.7 18.8 18.9 19. 19.1 19.2 19.3 19.4 19.5 19.6 19.7 19.8 19.9]
#now defining a function with varing of rangers from small to large i.e. in the orders of 10powers
y= (10**x)*(np.cos(x)**2)
print(y)
[1.00000000e+00 1.24637807e+00 1.52233825e+00 1.82101168e+00 2.13096728e+00 2.43543179e+00 2.71182195e+00 2.93186298e+00 3.06266846e+00 3.06927598e+00 2.91926582e+00 2.59023200e+00 2.08101456e+00 1.42772239e+00 7.25654593e-01 1.58232522e-01 3.39430992e-02 8.32016101e-01 3.25705177e+00 8.30201242e+00 1.73178190e+01 3.20861803e+01 5.48901710e+01 8.85744302e+01 1.36583697e+02 2.02964813e+02 2.92313508e+02 4.09643600e+02 5.60153166e+02 7.48860695e+02 9.80085143e+02 1.25674879e+03 1.57949260e+03 1.94561280e+03 2.34785710e+03 2.77316296e+03 3.20148096e+03 3.60490778e+03 3.94745794e+03 4.18593274e+03 4.27249983e+03 4.15977369e+03 3.80938070e+03 3.20518891e+03 2.37256447e+03 1.40515394e+03 5.00746735e+02 7.69217066e+00 4.83065492e+02 2.76321882e+03 8.04642355e+03 1.79859116e+04 3.47896531e+04 6.13205772e+04 1.01187589e+05 1.58813647e+05 2.39462431e+05 3.49199916e+05 4.94761930e+05 6.83294047e+05 9.21926979e+05 1.21715027e+06 1.57395133e+06 1.99469824e+06 2.47776568e+06 3.01593817e+06 3.59467676e+06 4.19040913e+06 4.76910368e+06 5.28551916e+06 5.68368609e+06 5.89937658e+06 5.86555217e+06 5.52203918e+06 4.83095439e+06 3.79966772e+06 2.51331062e+06 1.17896987e+06 1.83683508e+05 1.68095389e+05 2.11702598e+06 7.46715932e+06 1.82303956e+07 3.71290348e+07 6.77357069e+07 1.14606739e+08 1.83392409e+08 2.80901311e+08 4.15089093e+08 5.94934453e+08 8.30158354e+08 1.13073689e+09 1.50615584e+09 1.96435789e+09 2.51034458e+09 3.14441809e+09 3.86008763e+09 4.64172633e+09 5.46215387e+09 6.28044282e+09 7.04041031e+09 7.67046489e+09 8.08573553e+09 8.19371424e+09 7.90499042e+09 7.15102828e+09 5.91131507e+09 4.25254589e+09 2.38275442e+09 7.23368161e+08 1.95868027e+06 1.36784126e+09 6.53149933e+09 1.79268874e+10 3.88928091e+10 7.38655852e+10 1.28569946e+11 2.10188412e+11 3.27481347e+11 4.90820588e+11 7.12089504e+11 1.00439229e+12 1.38150667e+12 1.85700864e+12 2.44299859e+12 3.14836808e+12 3.97657107e+12 4.92290771e+12 5.97140050e+12 7.09144865e+12 8.23459661e+12 9.33195475e+12 1.02930722e+13 1.10073900e+13 1.13497966e+13 1.11922682e+13 1.04240770e+13 8.98358093e+12 6.90510149e+12 4.38480443e+12 1.86970668e+12 1.73825567e+11 6.24891762e+11 5.24376695e+12 1.69565041e+13 3.98356023e+13 7.93621701e+13 1.42694169e+14 2.38917474e+14 3.79246102e+14 5.77125725e+14 8.48181025e+14 1.20993332e+15 1.68120188e+15 2.28109245e+15 3.02747349e+15 3.93484808e+15 5.01155452e+15 6.25627730e+15 7.65393242e+15 9.17111680e+15 1.07514928e+16 1.23117271e+16 1.37389306e+16 1.48909617e+16 1.56014645e+16 1.56921124e+16 1.49952035e+16 1.33904772e+16 1.08607363e+16 7.57148626e+15 3.98022686e+15 9.81089828e+14 9.00036837e+13 3.67422530e+15 1.52275994e+16 3.96889435e+16 8.37951336e+16 1.56452423e+17 2.69098954e+17 4.36018155e+17 6.74546780e+17 1.00510322e+18 1.45094226e+18 2.03752351e+18 2.79136471e+18 3.73824230e+18 4.90060521e+18 6.29409114e+18 7.92308697e+18 9.77536822e+18 1.18159995e+19 1.39808953e+19 1.61707432e+19 1.82463984e+19 2.00273832e+19 2.12957725e+19 2.18085310e+19 2.13222601e+19 1.96352947e+19]
plt.plot(x,y)
plt.show()
#in theabove graph we cannot analyse the importance of the intial data. the graph gives the data of higher values only
#but there could be important information in the initial data as well. in such cases we use logarithms to decrese the order
#effect
#but how to do that in python graphs?
plt.plot(x,y)
plt.yscale("log") #this command to scale out for log
plt.show()
plt.plot(x,y)
plt.yscale("log")
plt.xscale("log")
plt.show()