Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import math
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
def breakeven(r,t,N):
r2=(1-t)*r
x=(1+r2)/(1+r)
return np.power(x,N)*t
N = np.arange(1,35,1)
y = breakeven(0.08,0.37,N)
y2 = breakeven(0.08,0.22,N)
matplotlib.rc('xtick', labelsize=20)
matplotlib.rc('ytick', labelsize=20)
font = {'family' : 'normal',
'weight' : 'bold',
'size' : 22}
matplotlib.rc('font', **font)
fig, ax = plt.subplots()
ax.plot(N,y,linewidth=3,label="$t_1=0.37$")
ax.plot(N,y2,linewidth=3,label="$t_1=0.22$")
ax.set_xlim(35, 0) # decreasing time
ax.set(xlabel="years to retire (N)", ylabel="lower bound on $t_2$ to make Roth more preferable")
ax.xaxis.label.set_fontsize(30)
ax.yaxis.label.set_fontsize(26)
ax.grid()
plt.legend(loc='best')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.