Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib
- matplotlib.use('TkAgg')
- from mpl_toolkits.mplot3d import Axes3D
- import matplotlib.pyplot as plt
- def norm_data():
- '''Return normalized data'''
- cagrs = []
- mus = range(0, 100)
- sigmas = [x*0.5 for x in range(0, 200)]
- for sigma in tqdm(sigmas):
- cagr = []
- for mu in mus:
- cagr.append(normal_returns(mu, sigma))
- cagrs.append(cagr)
- return (mus, sigmas, cagrs)
- norm_x, norm_y, norm_z = norm_data()
- fig = plt.figure()
- cp = plt.contour(norm_x, norm_y, norm_z)
- plt.clabel(cp, inline=True, fontsize=10)
- plt.title('Net CAGR')
- plt.xlabel('Mean Returns')
- plt.ylabel('Deviation')
- plt.show()
Add Comment
Please, Sign In to add comment