Skip to content

Commit fef8f11

Browse files
Thore KockerolsThore Kockerols
authored andcommitted
fix strings in joint shocks and variables
1 parent 2c63638 commit fef8f11

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/StatsPlotsExt.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -945,8 +945,8 @@ function plot_model_estimates!(𝓂::ℳ,
945945
legend_title = length(annotate_diff_input) > 2 ? nothing : annotate_diff_input[2][1],
946946
label = length(annotate_diff_input) > 2 ? k[:label] isa Symbol ? string(k[:label]) : k[:label] : annotate_diff_input[2][2][i] isa String ? annotate_diff_input[2][2][i] : String(Symbol(annotate_diff_input[2][2][i])))
947947

948-
push!(joint_shocks, String.(k[:shock_names])...)
949-
push!(joint_variables, String.(k[:variable_names])...)
948+
foreach(n -> push!(joint_variables, String(n)), k[:variable_names] isa AbstractVector ? k[:variable_names] : (k[:variable_names],))
949+
foreach(n -> push!(joint_shocks, String(n)), k[:shock_names] isa AbstractVector ? k[:shock_names] : (k[:shock_names],))
950950
end
951951

952952
if haskey(diffdict, :data) || haskey(diffdict, :presample_periods)
@@ -2600,8 +2600,8 @@ function plot_irf!(𝓂::ℳ;
26002600
label = length(annotate_diff_input) > 2 ? k[:label] isa Symbol ? string(k[:label]) : k[:label] : annotate_diff_input[2][2][i] isa String ? annotate_diff_input[2][2][i] : String(Symbol(annotate_diff_input[2][2][i])))
26012601
end
26022602

2603-
push!(joint_shocks, String.(k[:shock_names])...)
2604-
push!(joint_variables, String.(k[:variable_names])...)
2603+
foreach(n -> push!(joint_variables, String(n)), k[:variable_names] isa AbstractVector ? k[:variable_names] : (k[:variable_names],))
2604+
foreach(n -> push!(joint_shocks, String(n)), k[:shock_names] isa AbstractVector ? k[:shock_names] : (k[:shock_names],))
26052605

26062606
single_shock_per_irf = single_shock_per_irf && length(k[:shock_names]) == 1
26072607
end
@@ -4542,8 +4542,8 @@ function plot_conditional_forecast!(𝓂::ℳ,
45424542
label = length(annotate_diff_input) > 2 ? k[:label] isa Symbol ? string(k[:label]) : k[:label] : annotate_diff_input[2][2][i] isa String ? annotate_diff_input[2][2][i] : String(Symbol(annotate_diff_input[2][2][i])))
45434543
end
45444544

4545-
push!(joint_shocks, String.(k[:shock_names])...)
4546-
push!(joint_variables, String.(k[:variable_names])...)
4545+
foreach(n -> push!(joint_variables, String(n)), k[:variable_names] isa AbstractVector ? k[:variable_names] : (k[:variable_names],))
4546+
foreach(n -> push!(joint_shocks, String(n)), k[:shock_names] isa AbstractVector ? k[:shock_names] : (k[:shock_names],))
45474547
end
45484548

45494549
for (i,k) in enumerate(conditional_forecast_active_plot_container)

0 commit comments

Comments
 (0)