Advertisement
aslogor

plots.py

Apr 18th, 2021
1,099
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.16 KB | None | 0 0
  1. import numpy as np
  2. import pylab as plt
  3.  
  4.  
  5. data = np.loadtxt("Measurements.csv",delimiter=",")
  6. phis = data[:,0]
  7. E0 = data[:,12]
  8. E1 = data[:,13]
  9. E2 = data[:,14]
  10. E3 = data[:,15]
  11. E4 = data[:,16]
  12.  
  13.  
  14. phipts = np.linspace(0,2*np.pi,300)
  15. ticks = [r'$0$', r'$\frac{\pi}{4}$', r'$\frac{\pi}{2}$', r'$\frac{3\pi}{4}$', r'$\pi$',
  16.  r'$\frac{5\pi}{4}$', r'$\frac{3\pi}{2}$', r'$\frac{7\pi}{4}$', r'$2\pi$']
  17.  
  18.  
  19. plt.figure(figsize=(11,9))
  20. plt.plot(phis,E0,'o')
  21. plt.plot(phipts, 0.5*(1-np.abs(np.cos(phipts)) ) )
  22. plt.xlabel(r'$\varphi$',fontsize=20)
  23. plt.ylabel(r'$E_0$',fontsize=20)
  24. plt.xticks(np.arange(0,2*np.pi+0.1,step=np.pi/4),ticks)
  25. plt.tick_params(axis='both', which='major', labelsize=24, width=2.5, length=10)
  26. plt.savefig('E0.pdf')
  27.  
  28.  
  29. plt.figure(figsize=(11,9))
  30. # plt.tick_params(axis='both', which='major', labelsize=14, width=2.5, length=10)
  31. plt.plot(phis,E1,'o')
  32. plt.plot(phipts, 0.5*(1-np.abs(np.cos(phipts))**3 ) )
  33. plt.xlabel(r'$\varphi$',fontsize=20)
  34. plt.ylabel(r'$E_1$',fontsize=20)
  35. plt.xticks(np.arange(0,2*np.pi+0.1,step=np.pi/4),ticks)
  36. plt.tick_params(axis='both', which='major', labelsize=24, width=2.5, length=10)
  37. plt.savefig('E1.pdf')
  38.  
  39. plt.figure(figsize=(11,9))
  40. plt.plot(phis,E2,'o')
  41. plt.plot(phipts, 0.5*(1-np.abs(np.cos(phipts))**3 ) )
  42. plt.xlabel(r'$\varphi$',fontsize=20)
  43. plt.ylabel(r'$E_2$',fontsize=20)
  44. plt.xticks(np.arange(0,2*np.pi+0.1,step=np.pi/4),ticks)
  45. plt.tick_params(axis='both', which='major', labelsize=24, width=2.5, length=10)
  46. plt.savefig('E2.pdf')
  47.  
  48. plt.figure(figsize=(11,9))
  49. plt.plot(phis,E3,'o')
  50. plt.plot(phipts, 0.5*(1-np.abs(np.cos(phipts))**2 ) )
  51. plt.xlabel(r'$\varphi$',fontsize=20)
  52. plt.ylabel(r'$E_3$',fontsize=20)
  53. plt.xticks(np.arange(0,2*np.pi+0.1,step=np.pi/4),ticks)
  54. plt.tick_params(axis='both', which='major', labelsize=24, width=2.5, length=10)
  55. plt.savefig('E3.pdf')
  56.  
  57.  
  58. plt.figure(figsize=(11,9))
  59. plt.plot(phis,E4,'o')
  60. plt.plot(phipts, 0.5*(1-np.abs(np.cos(phipts)) ) )
  61. plt.xlabel(r'$\varphi$',fontsize=20)
  62. plt.ylabel(r'$E_4$',fontsize=20)
  63. plt.xticks(np.arange(0,2*np.pi+0.1,step=np.pi/4),ticks)
  64. plt.tick_params(axis='both', which='major', labelsize=24, width=2.5, length=10)
  65. plt.savefig('E4.pdf')
  66. # plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement