Skip to content

Commit 689abd4

Browse files
committed
reset ss page and handle shocks correctly
1 parent 2791d52 commit 689abd4

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

ext/StatsPlotsExt.jl

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,19 +1387,23 @@ function plot_irf!(𝓂::ℳ;
13871387
end
13881388
end
13891389

1390-
if haskey(diffdict, :shock_names)
1390+
if haskey(diffdict, :shocks)
13911391
if all(length.(diffdict[:shock_names]) .== 1)
1392-
push!(annotate_diff_input, "Shock" => reduce(vcat,diffdict[:shock_names]))
1392+
push!(annotate_diff_input, "Shock" => reduce(vcat,diffdict[:shocks]))
1393+
else
1394+
push!(annotate_diff_input, "Shock" => diffdict[:shocks])
13931395
end
13941396
end
1395-
1397+
13961398
same_shock_direction = true
1397-
1398-
for k in setdiff(keys(args_and_kwargs), [:run_id,
1399-
# :periods,
1400-
:shocks, :variables, :parameters, :initial_state, :plot_data, :tol, :reference_steady_state,
1401-
# :quadratic_matrix_equation_algorithm, :sylvester_algorithm, :lyapunov_algorithm,
1402-
:variable_names, :shock_names, :shock_idx, :var_idx])
1399+
1400+
for k in setdiff(keys(args_and_kwargs),
1401+
[
1402+
:run_id, :parameters, :initial_state, :plot_data, :tol, :reference_steady_state,
1403+
:shocks, :shock_names, :shock_idx,
1404+
:variables, :variable_names, :var_idx,
1405+
# :periods, :quadratic_matrix_equation_algorithm, :sylvester_algorithm, :lyapunov_algorithm,
1406+
])
14031407
if haskey(diffdict, k)
14041408
push!(annotate_diff_input, args_and_kwargs_names[k] => reduce(vcat,diffdict[k]))
14051409

@@ -1410,7 +1414,6 @@ function plot_irf!(𝓂::ℳ;
14101414
end
14111415

14121416
pushfirst!(annotate_diff_input, "Plot index" => 1:len_diff)
1413-
14141417

14151418
shock_dir = same_shock_direction ? negative_shock ? "Shock⁻" : "Shock⁺" : "Shock"
14161419

@@ -1429,7 +1432,7 @@ function plot_irf!(𝓂::ℳ;
14291432
joint_shocks = OrderedSet{String}()
14301433
joint_variables = OrderedSet{String}()
14311434
single_shock_per_irf = true
1432-
1435+
14331436
for (i,k) in enumerate(irf_active_plot_container)
14341437
StatsPlots.plot!(legend_plot,
14351438
fill(0,1,1),
@@ -1686,6 +1689,8 @@ function plot_irf!(𝓂::ℳ;
16861689
end
16871690

16881691
annotate_ss = Vector{Pair{String, Any}}[]
1692+
1693+
annotate_ss_page = Pair{String,Any}[]
16891694
end
16901695

16911696
return return_plots

0 commit comments

Comments
 (0)