#!/usr/bin/env python

from scipy.special import legendre

import math
import numpy as np
import matplotlib.pyplot as plt

#----------------------------------------------------------------------------------------#

data  = np.loadtxt("phase_function_legendre_polynomial_expansion_02.txt")

#----------------------------------------------------------------------------------------#

plt.plot(data[:,0],data[:,1],'r',
      label='P11 phase function reconstructed \n from its Legendre polynomial expansion')
plt.plot(data[:,0],data[:,2],'k--',label='P11 true phase function')

plt.legend()
plt.xlabel(r"Scattering Angle $\Theta$ ($^\circ$)")
plt.ylabel(r"$P_{11}$")
plt.title('Phase function and its Legendre polynomial expansion \n (n=120)')

plt.ylim(10**(-2.0),10**6)
plt.yscale('log')
plt.grid(True,which="both")

plt.savefig('phase_function_legendre_polynomial_expansion.png', bbox_inches='tight')
plt.show()

#----------------------------------------------------------------------------------------#

About / Au sujet de

Ben
Created:
9 mai 2017 20:44:34

Updated:
9 mai 2017 20:44:34

License / Licence

MIT License

Abstract / Résumé