@@ -444,8 +444,8 @@ u1_star = - ex1_a.Fs[0, 0, 1] - ex1_a.Fs[0, 0, 0] * k_grid
444444u2_star = - ex1_a.Fs[1, 0, 1] - ex1_a.Fs[1, 0, 0] * k_grid
445445
446446fig, ax = plt.subplots()
447- ax.plot(k_grid, k_grid + u1_star, label="$\overline{s}_1$ (high)")
448- ax.plot(k_grid, k_grid + u2_star, label="$\overline{s}_2$ (low)")
447+ ax.plot(k_grid, k_grid + u1_star, label=r "$\overline{s}_1$ (high)")
448+ ax.plot(k_grid, k_grid + u2_star, label=r "$\overline{s}_2$ (low)")
449449
450450# The optimal k*
451451ax.scatter([0.5, 0.5], [0.5, 0.5], marker="*")
@@ -546,10 +546,10 @@ for i, λ in enumerate(λ_vals):
546546``` {code-cell} python3
547547for i, state_var in enumerate(state_vec1):
548548 fig, ax = plt.subplots()
549- ax.plot(λ_vals, F1[:, i], label="$\overline{s}_1$", color="b")
550- ax.plot(λ_vals, F2[:, i], label="$\overline{s}_2$", color="r")
549+ ax.plot(λ_vals, F1[:, i], label=r "$\overline{s}_1$", color="b")
550+ ax.plot(λ_vals, F2[:, i], label=r "$\overline{s}_2$", color="r")
551551
552- ax.set_xlabel("$\lambda$")
552+ ax.set_xlabel(r "$\lambda$")
553553 ax.set_ylabel("$F_{s_t}$")
554554 ax.set_title(f"Coefficient on {state_var}")
555555 ax.legend()
@@ -617,8 +617,8 @@ for i, state_var in enumerate(state_vec1):
617617 ax.plot_surface(λ_grid, δ_grid, F1_grid[:, :, i], color="b")
618618 # low adjustment cost, red surface
619619 ax.plot_surface(λ_grid, δ_grid, F2_grid[:, :, i], color="r")
620- ax.set_xlabel("$\lambda$")
621- ax.set_ylabel("$\delta$")
620+ ax.set_xlabel(r "$\lambda$")
621+ ax.set_ylabel(r "$\delta$")
622622 ax.set_zlabel("$F_{s_t}$")
623623 ax.set_title(f"coefficient on {state_var}")
624624 plt.show()
@@ -656,11 +656,11 @@ def run(construct_func, vals_dict, state_vec):
656656 for i, state_var in enumerate(state_vec):
657657 fig = plt.figure()
658658 ax = fig.add_subplot(111)
659- ax.plot(λ_vals, F1[:, i], label="$\overline{s}_1$", color="b")
660- ax.plot(λ_vals, F2[:, i], label="$\overline{s}_2$", color="r")
659+ ax.plot(λ_vals, F1[:, i], label=r "$\overline{s}_1$", color="b")
660+ ax.plot(λ_vals, F2[:, i], label=r "$\overline{s}_2$", color="r")
661661
662- ax.set_xlabel("$\lambda$")
663- ax.set_ylabel("$F(\overline{s}_t)$")
662+ ax.set_xlabel(r "$\lambda$")
663+ ax.set_ylabel(r "$F(\overline{s}_t)$")
664664 ax.set_title(f"coefficient on {state_var}")
665665 ax.legend()
666666 plt.show()
@@ -674,17 +674,17 @@ def run(construct_func, vals_dict, state_vec):
674674 F = [F1, F2][i]
675675 c = ["b", "r"][i]
676676 ax.plot([0, 1], [k_star[i], k_star[i]], "--",
677- color=c, label="$k^*(\overline{s}_"+str(i+1)+")$")
677+ color=c, label=r "$k^*(\overline{s}_"+str(i+1)+")$")
678678 ax.plot(λ_vals, - F[:, 1] / F[:, 0], color=c,
679- label="$k^{target}(\overline{s}_"+str(i+1)+")$")
679+ label=r "$k^{target}(\overline{s}_"+str(i+1)+")$")
680680
681681 # Plot a vertical line at λ=0.5
682682 ax.plot([0.5, 0.5], [min(k_star), max(k_star)], "-.")
683683
684- ax.set_xlabel("$\lambda$")
684+ ax.set_xlabel(r "$\lambda$")
685685 ax.set_ylabel("$k$")
686686 ax.set_title("Optimal k levels and k targets")
687- ax.text(0.5, min(k_star)+(max(k_star)-min(k_star))/20, "$\lambda=0.5$")
687+ ax.text(0.5, min(k_star)+(max(k_star)-min(k_star))/20, r "$\lambda=0.5$")
688688 ax.legend(bbox_to_anchor=(1., 1.))
689689 plt.show()
690690
@@ -714,9 +714,9 @@ def run(construct_func, vals_dict, state_vec):
714714 ax = fig.add_subplot(111, projection='3d')
715715 ax.plot_surface(λ_grid, δ_grid, F1_grid[:, :, i], color="b")
716716 ax.plot_surface(λ_grid, δ_grid, F2_grid[:, :, i], color="r")
717- ax.set_xlabel("$\lambda$")
718- ax.set_ylabel("$\delta$")
719- ax.set_zlabel("$F(\overline{s}_t)$")
717+ ax.set_xlabel(r "$\lambda$")
718+ ax.set_ylabel(r "$\delta$")
719+ ax.set_zlabel(r "$F(\overline{s}_t)$")
720720 ax.set_title(f"coefficient on {state_var}")
721721 plt.show()
722722```
0 commit comments