#! /usr/bin/env python # plot3.py # # Example python program introducing the use # of the matplotlib module. # # Paul Eugenio # PHZ4151C # Jan 28, 2019 # import matplotlib.pyplot as plt plt.rc('text', usetex=True) import numpy as np def cross_section(t, b): """ The transverse four-momentum scattering cross section: t * exp(-t) """ return (t-b)**2 * np.exp(-t) # # Generate an array of values to plot # x = np.linspace(0,10,101) b = 0 y = cross_section(x,b) # Plot data and set plot for multiple plot overlays plt.plot(x,y) #plt.hold(True) # Generate additional data and plot b = 1 y = cross_section(x,b) plt.plot(x,y) # Dress up figure plt.legend(["\sigma(t,0) = t^2 e^{-t}", "\sigma(t,1) = (t-1)^2 e^{-t}"]) plt.title("Scattering Probability") plt.xlabel("t") plt.ylabel("\sigma(t,b)") plt.show()