# import matplotlib # matplotlib.use('agg') import matplotlib.pyplot as plt import math # plot the modified cosine function as a unit of degrees # intent is to find 'goodness' function giving max result at # multiples of 90 degrees degrees = [] cosines = [] for i in range(0, 360): degrees.append(i) cosines.append(math.fabs(math.cos(2 * math.radians(i)))) plt.plot(degrees, cosines) plt.ylabel("fabs(cos(2 * radians(i)))") plt.xlabel("degrees") plt.show()