Skip to content

Commit 98021cd

Browse files
Merge pull request #164 from QuantEcon/latexstrings
Finish #122: port plot text to LaTeXStrings
2 parents 10ca411 + f8b7025 commit 98021cd

37 files changed

+263
-256
lines changed

lectures/Manifest.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,12 @@ git-tree-sha1 = "f6250b16881adf048549549fba48b1161acdac8c"
971971
uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d"
972972
version = "3.100.1+0"
973973

974+
[[deps.LERC_jll]]
975+
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
976+
git-tree-sha1 = "bf36f528eec6634efc60d7ec062008f171071434"
977+
uuid = "88015f11-f218-50d7-93a8-a6af411a945d"
978+
version = "3.0.0+1"
979+
974980
[[deps.LZO_jll]]
975981
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
976982
git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6"
@@ -1084,10 +1090,10 @@ uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9"
10841090
version = "2.35.0+0"
10851091

10861092
[[deps.Libtiff_jll]]
1087-
deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"]
1088-
git-tree-sha1 = "340e257aada13f95f98ee352d316c3bed37c8ab9"
1093+
deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"]
1094+
git-tree-sha1 = "c9551dd26e31ab17b86cbd00c2ede019c08758eb"
10891095
uuid = "89763e89-9b03-5906-acba-b20f662cd828"
1090-
version = "4.3.0+0"
1096+
version = "4.3.0+1"
10911097

10921098
[[deps.Libuuid_jll]]
10931099
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]

lectures/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
2626
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
2727
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
2828
KernelDensity = "5ab0869b-81aa-558d-bb23-cbf5423bbe9b"
29+
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
2930
LeastSquaresOptim = "0fc2ff8b-aaa3-5acd-a817-1944a5e08891"
3031
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
3132
LinearMaps = "7a12625a-238d-50fd-b39a-03d52299707e"

lectures/continuous_time/covid_sde.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Every other Levy Process can be represented by these building blocks (e.g. a [Di
5454
In this lecture, we will examine shocks driven by transformations of Brownian motion, as the prototypical Stochastic Differential Equation (SDE).
5555

5656
```{code-cell} julia
57-
using LinearAlgebra, Statistics, Random, SparseArrays
57+
using LaTeXStrings, LinearAlgebra, Random, SparseArrays, Statistics
5858
```
5959

6060
```{code-cell} julia
@@ -284,25 +284,25 @@ If we take two solutions and plot the number of infections, we will see differen
284284
```{code-cell} julia
285285
sol_2 = solve(prob, SOSRI())
286286
plot(sol_1, vars=[2], title = "Number of Infections", label = "Trajectory 1",
287-
lm = 2, xlabel = "t", ylabel = "i(t)")
288-
plot!(sol_2, vars=[2], label = "Trajectory 2", lm = 2, ylabel = "i(t)")
287+
lm = 2, xlabel = L"t", ylabel = L"i(t)")
288+
plot!(sol_2, vars=[2], label = "Trajectory 2", lm = 2, xlabel = L"t", ylabel = L"i(t)")
289289
```
290290

291291
The same holds for other variables such as the cumulative deaths, mortality, and $R_0$:
292292

293293
```{code-cell} julia
294294
plot_1 = plot(sol_1, vars=[4], title = "Cumulative Death Proportion", label = "Trajectory 1",
295-
lw = 2, xlabel = "t", ylabel = "d(t)", legend = :topleft)
296-
plot!(plot_1, sol_2, vars=[4], label = "Trajectory 2", lw = 2)
295+
lw = 2, xlabel = L"t", ylabel = L"d(t)", legend = :topleft)
296+
plot!(plot_1, sol_2, vars=[4], label = "Trajectory 2", lw = 2, xlabel = L"t")
297297
plot_2 = plot(sol_1, vars=[3], title = "Cumulative Recovered Proportion", label = "Trajectory 1",
298-
lw = 2, xlabel = "t", ylabel = "d(t)", legend = :topleft)
299-
plot!(plot_2, sol_2, vars=[3], label = "Trajectory 2", lw = 2)
300-
plot_3 = plot(sol_1, vars=[5], title = "R_0 transition from lockdown", label = "Trajectory 1",
301-
lw = 2, xlabel = "t", ylabel = "R_0(t)")
302-
plot!(plot_3, sol_2, vars=[5], label = "Trajectory 2", lw = 2)
298+
lw = 2, xlabel = L"t", ylabel = L"d(t)", legend = :topleft)
299+
plot!(plot_2, sol_2, vars=[3], label = "Trajectory 2", lw = 2, xlabel = L"t")
300+
plot_3 = plot(sol_1, vars=[5], title = L"$R_0$ transition from lockdown", label = "Trajectory 1",
301+
lw = 2, xlabel = L"t", ylabel = L"R_0(t)")
302+
plot!(plot_3, sol_2, vars=[5], label = "Trajectory 2", lw = 2, xlabel = L"t")
303303
plot_4 = plot(sol_1, vars=[6], title = "Mortality Rate", label = "Trajectory 1",
304-
lw = 2, xlabel = "t", ylabel = "delta(t)", ylim = (0.006, 0.014))
305-
plot!(plot_4, sol_2, vars=[6], label = "Trajectory 2", lw = 2)
304+
lw = 2, xlabel = L"t", ylabel = L"\delta(t)", ylim = (0.006, 0.014))
305+
plot!(plot_4, sol_2, vars=[6], label = "Trajectory 2", lw = 2, xlabel = L"t")
306306
plot(plot_1, plot_2, plot_3, plot_4, size = (900, 600))
307307
```
308308

@@ -324,7 +324,7 @@ For example:
324324
```{code-cell} julia
325325
ensembleprob = EnsembleProblem(prob)
326326
sol = solve(ensembleprob, SOSRI(), EnsembleSerial(), trajectories = 10)
327-
plot(sol, vars = [2], title = "Infection Simulations", ylabel = "i(t)", xlabel = "t", lm = 2)
327+
plot(sol, vars = [2], title = "Infection Simulations", ylabel = L"i(t)", xlabel = L"t", lm = 2)
328328
```
329329

330330
Or, more frequently, you may want to run many trajectories and plot quantiles, which can be automatically run in [parallel](https://docs.sciml.ai/stable/features/ensemble/) using multiple threads, processes, or GPUs. Here we showcase `EnsembleSummary` which calculates summary information from an ensemble and plots the mean of the solution along with calculated quantiles of the simulation:
@@ -333,8 +333,8 @@ Or, more frequently, you may want to run many trajectories and plot quantiles, w
333333
trajectories = 100 # choose larger for smoother quantiles
334334
sol = solve(ensembleprob, SOSRI(), EnsembleThreads(), trajectories = trajectories)
335335
summ = EnsembleSummary(sol) # defaults to saving 0.05, 0.95 quantiles
336-
plot(summ, idxs = (2,), title = "Quantiles of Infections Ensemble", ylabel = "i(t)",
337-
xlabel = "t", labels = "Middle 95% Quantile", legend = :topright)
336+
plot(summ, idxs = (2,), title = "Quantiles of Infections Ensemble", ylabel = L"i(t)",
337+
xlabel = L"t", labels = "Middle 95% Quantile", legend = :topright)
338338
```
339339

340340
In addition, you can calculate more quantiles and stack graphs
@@ -345,8 +345,8 @@ summ = EnsembleSummary(sol) # defaults to saving 0.05, 0.95 quantiles
345345
summ2 = EnsembleSummary(sol, quantiles = (0.25, 0.75))
346346
347347
plot(summ, idxs = (2,4,5,6),
348-
title = ["Proportion Infected" "Proportion Dead" "R_0" "delta"],
349-
ylabel = ["i(t)" "d(t)" "R_0(t)" "delta(t)"], xlabel = "t",
348+
title = ["Proportion Infected" "Proportion Dead" L"R_0" L"\delta"],
349+
ylabel = [L"i(t)" L"d(t)" L"R_0(t)" L"\delta(t)"], xlabel = L"t",
350350
legend = [:topleft :topleft :bottomright :bottomright],
351351
labels = "Middle 95% Quantile", layout = (2, 2), size = (900, 600))
352352
plot!(summ2, idxs = (2,4,5,6),
@@ -385,14 +385,14 @@ end
385385
summ_1 = generate_η_experiment(η_1)
386386
summ_2 = generate_η_experiment(η_2)
387387
plot(summ_1, idxs = (4,5),
388-
title = ["Proportion Dead" "R_0"],
389-
ylabel = ["d(t)" "R_0(t)"], xlabel = "t",
388+
title = ["Proportion Dead" L"R_0"],
389+
ylabel = [L"d(t)" L"R_0(t)"], xlabel = L"t",
390390
legend = [:topleft :bottomright],
391-
labels = "Middle 95% Quantile, eta = $η_1",
391+
labels = L"Middle 95% Quantile, $\eta = %$η_1$",
392392
layout = (2, 1), size = (900, 900), fillalpha = 0.5)
393393
plot!(summ_2, idxs = (4,5),
394394
legend = [:topleft :bottomright],
395-
labels = "Middle 95% Quantile, eta = $η_2", size = (900, 900), fillalpha = 0.5)
395+
labels = L"Middle 95% Quantile, $\eta = %$η_2$", size = (900, 900), fillalpha = 0.5)
396396
```
397397

398398
While the the mean of the $d(t)$ increases, unsurprisingly, we see that the 95% quantile for later time periods is also much larger - even after the $R_0$ has converged.
@@ -439,14 +439,14 @@ Simulating for a single realization of the shocks, we see the results are qualit
439439
sol_early = solve(prob_early, SOSRI())
440440
sol_late = solve(prob_late, SOSRI())
441441
plot(sol_early, vars = [5, 1,2,4],
442-
title = ["R_0" "Susceptible" "Infected" "Dead"],
442+
title = [L"R_0" "Susceptible" "Infected" "Dead"],
443443
layout = (2, 2), size = (900, 600),
444-
ylabel = ["R_0(t)" "s(t)" "i(t)" "d(t)"], xlabel = "t",
444+
ylabel = [L"R_0(t)" L"s(t)" L"i(t)" L"d(t)"], xlabel = L"t",
445445
legend = [:bottomright :topright :topright :topleft],
446446
label = ["Early" "Early" "Early" "Early"])
447447
plot!(sol_late, vars = [5, 1,2,4],
448448
legend = [:bottomright :topright :topright :topleft],
449-
label = ["Late" "Late" "Late" "Late"])
449+
label = ["Late" "Late" "Late" "Late"], xlabel = L"t")
450450
```
451451

452452
However, note that this masks highly volatile values induced by the in $R_0$ variation, as seen in the ensemble
@@ -462,8 +462,8 @@ summ_early = EnsembleSummary(ensemble_sol_early)
462462
summ_late = EnsembleSummary(ensemble_sol_late)
463463
464464
plot(summ_early, idxs = (5, 1, 2, 4),
465-
title = ["R_0" "Susceptible" "Infected" "Dead"], layout = (2, 2), size = (900, 600),
466-
ylabel = ["R_0(t)" "s(t)" "i(t)" "d(t)"], xlabel = "t",
465+
title = [L"R_0" "Susceptible" "Infected" "Dead"], layout = (2, 2), size = (900, 600),
466+
ylabel = [L"R_0(t)" L"s(t)" L"i(t)" L"d(t)"], xlabel = L"t",
467467
legend = [:bottomright :topright :topright :topleft],
468468
label = ["Early" "Early" "Early" "Early"])
469469
plot!(summ_late, idxs = (5, 1,2,4),
@@ -485,12 +485,12 @@ bins_2 = 30 # number rather than grid.
485485
hist_1 = histogram([ensemble_sol_early.u[i](t_1)[4] for i in 1:trajectories],
486486
fillalpha = 0.5, normalize = :probability,
487487
legend = :topleft, bins = bins_1,
488-
label = "Early", title = "Death Proportion at t = $t_1")
488+
label = "Early", title = L"Death Proportion at $t = %$t_1$")
489489
histogram!(hist_1, [ensemble_sol_late.u[i](t_1)[4] for i in 1:trajectories],
490490
label = "Late", fillalpha = 0.5, normalize = :probability, bins = bins_1)
491491
hist_2 = histogram([ensemble_sol_early.u[i][4, end] for i in 1:trajectories],
492492
fillalpha = 0.5, normalize = :probability, bins = bins_2,
493-
label = "Early", title = "Death Proportion at t = $t_2")
493+
label = "Early", title = L"Death Proportion at $t = %$t_2$")
494494
histogram!(hist_2, [ensemble_sol_late.u[i][4, end] for i in 1:trajectories],
495495
label = "Late", fillalpha = 0.5, normalize = :probability, bins = bins_2)
496496
plot(hist_1, hist_2, size = (600,600), layout = (2, 1))
@@ -572,12 +572,12 @@ The ensemble simulations for the $\nu = 0$ and $\nu > 0$ can be compared to see
572572
plot(summ_late, idxs = (1, 2, 3, 4),
573573
title = ["Susceptible" "Infected" "Recovered" "Dead"],
574574
layout = (2, 2), size = (900, 600),
575-
ylabel = ["s(t)" "i(t)" "r(t)" "d(t)"], xlabel = "t",
575+
ylabel = [L"s(t)" L"i(t)" L"r(t)" L"d(t)"], xlabel = L"t",
576576
legend = :topleft,
577-
label = ["s(t)" "i(t)" "r(t)" "d(t)"])
577+
label = [L"s(t)" L"i(t)" L"r(t)" L"d(t)"])
578578
plot!(summ_re_late, idxs = (1, 2, 3, 4),
579579
legend = :topleft,
580-
label = ["s(t); nu > 0" "i(t); nu > 0" "r(t); nu > 0" "d(t); nu > 0"])
580+
label = [L"s(t); \nu > 0" L"i(t); \nu > 0" L"r(t); \nu > 0" L"d(t); \nu > 0"])
581581
```
582582

583583
Finally, we can examine the same early vs. late lockdown histogram
@@ -588,12 +588,12 @@ bins_re_2 = range(0.0085, 0.0102, length = 50)
588588
hist_re_1 = histogram([ensemble_sol_re_early.u[i](t_1)[4] for i in 1:trajectories],
589589
fillalpha = 0.5, normalize = :probability,
590590
legend = :topleft, bins = bins_re_1,
591-
label = "Early", title = "Death Proportion at t = $t_1")
591+
label = "Early", title = L"Death Proportion at $t = %$t_1$")
592592
histogram!(hist_re_1, [ensemble_sol_re_late.u[i](t_1)[4] for i in 1:trajectories],
593593
label = "Late", fillalpha = 0.5, normalize = :probability, bins = bins_re_1)
594594
hist_re_2 = histogram([ensemble_sol_re_early.u[i][4, end] for i in 1:trajectories],
595595
fillalpha = 0.5, normalize = :probability, bins = bins_re_2,
596-
label = "Early", title = "Death Proportion at t = $t_2")
596+
label = "Early", title = L"Death Proportion at $t = %$t_2$")
597597
histogram!(hist_re_2, [ensemble_sol_re_late.u[i][4, end] for i in 1:trajectories],
598598
label = "Late", fillalpha = 0.5, normalize = :probability,
599599
bins = bins = bins_re_2)

lectures/continuous_time/seir_model.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The interest is primarily in
5353

5454

5555
```{code-cell} julia
56-
using LinearAlgebra, Statistics, Random, SparseArrays
56+
using LaTeXStrings, LinearAlgebra, Random, SparseArrays, Statistics
5757
```
5858

5959
```{code-cell} julia
@@ -199,15 +199,15 @@ With this, choose an ODE algorithm and solve the initial value problem. A good
199199

200200
```{code-cell} julia
201201
sol = solve(prob, Tsit5())
202-
plot(sol, labels = ["s" "e" "i" "r"], title = "SEIR Dynamics", lw = 2)
202+
plot(sol, labels = [L"s" L"e" L"i" L"r"], title = "SEIR Dynamics", lw = 2, xlabel = L"t")
203203
```
204204

205205
We did not provide either a set of time steps or a `dt` time step size to the `solve`. Most accurate and high-performance ODE solvers appropriate for this problem use adaptive time-stepping, changing the step size based the degree of curvature in the derivatives.
206206

207207
Or, as an alternative visualization, the proportions in each state over time
208208

209209
```{code-cell} julia
210-
areaplot(sol.t, sol', labels = ["s" "e" "i" "r"], title = "SEIR Proportions")
210+
areaplot(sol.t, sol', labels = [L"s" L"e" L"i" L"r"], title = "SEIR Proportions", xlabel = L"t")
211211
```
212212

213213
While maintaining the core system of ODEs in $(s, e, i, r)$, we will extend the basic model to enable some policy experiments and calculations of aggregate values.
@@ -354,9 +354,9 @@ While it may seem that 45 time intervals is extremely small for that range, for
354354
The solution object has [built in](https://docs.sciml.ai/stable/basics/plot/) plotting support.
355355

356356
```{code-cell} julia
357-
plot(sol, vars = [6, 7], label = ["c(t)" "d(t)"], lw = 2,
357+
plot(sol, vars = [6, 7], label = [L"c(t)" L"d(t)"], lw = 2,
358358
title = ["Cumulative Infected" "Death Proportion"],
359-
layout = (1,2), size = (900, 300))
359+
xlabel = L"t", layout = (1,2), size = (900, 300))
360360
```
361361

362362
A few more comments:
@@ -384,10 +384,10 @@ Changing the saved points is just a question of storage/interpolation, and does
384384
Let's plot current cases as a fraction of the population.
385385

386386
```{code-cell} julia
387-
labels = permutedims(["R_0 = $r" for r in R₀_n_vals])
387+
labels = permutedims([L"R_0 = %$r" for r in R₀_n_vals])
388388
infecteds = [sol[3,:] for sol in sols]
389-
plot(infecteds, label=labels, legend=:topleft, lw = 2, xlabel = "t",
390-
ylabel = "i(t)", title = "Current Cases")
389+
plot(infecteds, label=labels, legend=:topleft, lw = 2, xlabel = L"t",
390+
ylabel = L"i(t)", title = "Current Cases")
391391
```
392392

393393
As expected, lower effective transmission rates defer the peak of infections.
@@ -398,8 +398,8 @@ Here is cumulative cases, as a fraction of population:
398398

399399
```{code-cell} julia
400400
cumulative_infected = [sol[6,:] for sol in sols]
401-
plot(cumulative_infected, label=labels ,legend=:topleft, lw = 2, xlabel = "t",
402-
ylabel = "c(t)", title = "Cumulative Cases")
401+
plot(cumulative_infected, label=labels ,legend=:topleft, lw = 2, xlabel = L"t",
402+
ylabel = L"c(t)", title = "Cumulative Cases")
403403
```
404404

405405
### Experiment 2: Changing Mitigation
@@ -420,7 +420,7 @@ We consider several different rates:
420420

421421
```{code-cell} julia
422422
η_vals = [1/5, 1/10, 1/20, 1/50, 1/100]
423-
labels = permutedims(["eta = $η" for η in η_vals]);
423+
labels = permutedims([L"\eta = %$η" for η in η_vals]);
424424
```
425425

426426
Let's calculate the time path of infected people, current cases, and mortality
@@ -434,23 +434,23 @@ Next, plot the $R_0$ over time:
434434

435435
```{code-cell} julia
436436
Rs = [sol[5,:] for sol in sols]
437-
plot(Rs, label=labels, legend=:topright, lw = 2, xlabel = "t",
438-
ylabel = "R_0(t)", title = "Basic Reproduction Number")
437+
plot(Rs, label=labels, legend=:topright, lw = 2, xlabel = L"t",
438+
ylabel = L"R_0(t)", title = "Basic Reproduction Number")
439439
```
440440

441441
Now let's plot the number of infected persons and the cumulative number
442442
of infected persons:
443443

444444
```{code-cell} julia
445445
infecteds = [sol[3,:] for sol in sols]
446-
plot(infecteds, label=labels, legend=:topleft, lw = 2, xlabel = "t",
447-
ylabel = "i(t)", title = "Current Infected")
446+
plot(infecteds, label=labels, legend=:topleft, lw = 2, xlabel = L"t",
447+
ylabel = L"i(t)", title = "Current Infected")
448448
```
449449

450450
```{code-cell} julia
451451
cumulative_infected = [sol[6,:] for sol in sols]
452-
plot(cumulative_infected, label=labels ,legend=:topleft, lw = 2, xlabel = "t",
453-
ylabel = "c(t)", title = "Cumulative Infected")
452+
plot(cumulative_infected, label=labels ,legend=:topleft, lw = 2, xlabel = L"t",
453+
ylabel = L"c(t)", title = "Cumulative Infected")
454454
```
455455

456456
## Ending Lockdown
@@ -495,7 +495,7 @@ Let's calculate the paths:
495495
sol_early = solve(prob_early, Tsit5(), tstops = [30.0, 120.0])
496496
sol_late = solve(prob_late, Tsit5(), tstops = [30.0, 120.0])
497497
plot(sol_early, vars = [7], title = "Total Mortality", label = "Lift Early", legend = :topleft)
498-
plot!(sol_late, vars = [7], label = "Lift Late")
498+
plot!(sol_late, vars = [7], label = "Lift Late", xlabel = L"t")
499499
```
500500

501501
Next we examine the daily deaths, $\frac{d D(t)}{dt} = N \delta \gamma i(t)$.
@@ -504,7 +504,7 @@ Next we examine the daily deaths, $\frac{d D(t)}{dt} = N \delta \gamma i(t)$.
504504
flow_deaths(sol, p) = p.N * p.δ * p.γ * sol[3,:]
505505
506506
plot(sol_early.t, flow_deaths(sol_early, p_early), title = "Flow Deaths", label = "Lift Early")
507-
plot!(sol_late.t, flow_deaths(sol_late, p_late), label = "Lift Late")
507+
plot!(sol_late.t, flow_deaths(sol_late, p_late), label = "Lift Late", xlabel = L"t")
508508
```
509509

510510
Pushing the peak of curve further into the future may reduce cumulative deaths

lectures/dynamic_programming/career.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ using Test
154154
```
155155

156156
```{code-cell} julia
157-
using Plots, QuantEcon, Distributions
157+
using LaTeXStrings, Plots, QuantEcon, Distributions
158158
159159
160160
n = 50
@@ -163,7 +163,7 @@ b_vals = [0.5, 1, 100]
163163
164164
plt = plot()
165165
for (a, b) in zip(a_vals, b_vals)
166-
ab_label = "a = $a, b = $b"
166+
ab_label = L"$a = %$a, b = %$b$"
167167
dist = BetaBinomial(n, a, b)
168168
plot!(plt, 0:n, pdf.(dist, support(dist)), label = ab_label)
169169
end
@@ -274,7 +274,7 @@ v_init = fill(100.0, wp.N, wp.N)
274274
func(x) = update_bellman(wp, x)
275275
v = compute_fixed_point(func, v_init, max_iter = 500, verbose = false)
276276
277-
plot(linetype = :surface, wp.θ, wp.ϵ, transpose(v), xlabel="theta", ylabel="epsilon",
277+
plot(linetype = :surface, wp.θ, wp.ϵ, transpose(v), xlabel=L"\theta", ylabel=L"\epsilon",
278278
seriescolor=:plasma, gridalpha = 1)
279279
```
280280

@@ -392,8 +392,8 @@ end
392392
plot_array = Any[]
393393
for i in 1:2
394394
θ_path, ϵ_path = gen_path()
395-
plt = plot(ϵ_path, label="epsilon")
396-
plot!(plt, θ_path, label="theta")
395+
plt = plot(ϵ_path, label=L"\epsilon")
396+
plot!(plt, θ_path, label=L"\theta")
397397
plot!(plt, legend=:bottomright)
398398
push!(plot_array, plt)
399399
end
@@ -487,7 +487,7 @@ y_grid = range(0, 5, length = 50)
487487
488488
contour(x_grid, y_grid, optimal_policy', fill=true, levels=lvls,color = :Blues,
489489
fillalpha=1, cbar = false)
490-
contour!(xlabel="theta", ylabel="epsilon")
490+
contour!(xlabel=L"\theta", ylabel=L"\epsilon")
491491
annotate!([(1.8,2.5, text("new life", 14, :white, :center))])
492492
annotate!([(4.5,2.5, text("new job", 14, :center))])
493493
annotate!([(4.0,4.5, text("stay put", 14, :center))])
@@ -505,7 +505,7 @@ y_grid = range(0, 5, length = 50)
505505
506506
contour(x_grid, y_grid, optimal_policy', fill=true, levels=lvls,color = :Blues,
507507
fillalpha=1, cbar = false)
508-
contour!(xlabel="theta", ylabel="epsilon")
508+
contour!(xlabel=L"\theta", ylabel=L"\epsilon")
509509
annotate!([(1.8,2.5, text("new life", 14, :white, :center))])
510510
annotate!([(4.5,2.5, text("new job", 14, :center))])
511511
annotate!([(4.0,4.5, text("stay put", 14, :center))])

0 commit comments

Comments
 (0)