Skip to content

Commit 2da104c

Browse files
committed
Fix state handling in _plot_solution_from_container by converting state to Symbol
1 parent 12546f1 commit 2da104c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/StatsPlotsExt.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4024,7 +4024,7 @@ function _plot_solution_from_container(;
40244024
end
40254025

40264026
# Create plot title including state info
4027-
state_string = length(joint_states) > 1 ? " State: " * replace_indices_in_symbol(state) : ""
4027+
state_string = length(joint_states) > 1 ? " State: " * replace_indices_in_symbol(Symbol(state)) : ""
40284028
plot_title = "Model: "*model_name*state_string*" ("*string(pane)*"/"*string(Int(ceil(n_subplots/plots_per_page)))*")"
40294029

40304030
# Create final plot with appropriate layout
@@ -4042,7 +4042,7 @@ function _plot_solution_from_container(;
40424042

40434043
if save_plots
40444044
if !isdir(save_plots_path) mkpath(save_plots_path) end
4045-
state_name = replace_indices_in_symbol(state)
4045+
state_name = replace_indices_in_symbol(Symbol(state))
40464046
StatsPlots.savefig(p, save_plots_path * "/" * string(save_plots_name) * "__" * model_name * "__" * state_name * "__" * string(pane) * "." * string(save_plots_format))
40474047
end
40484048

@@ -4068,7 +4068,7 @@ function _plot_solution_from_container(;
40684068
end
40694069

40704070
# Create plot title including state info
4071-
state_string = length(joint_states) > 1 ? " State: " * replace_indices_in_symbol(state) : ""
4071+
state_string = length(joint_states) > 1 ? " State: " * replace_indices_in_symbol(Symbol(state)) : ""
40724072
plot_title = "Model: "*model_name*state_string*" ("*string(pane)*"/"*string(Int(ceil(n_subplots/plots_per_page)))*")"
40734073

40744074
# Create final plot with appropriate layout
@@ -4086,7 +4086,7 @@ function _plot_solution_from_container(;
40864086

40874087
if save_plots
40884088
if !isdir(save_plots_path) mkpath(save_plots_path) end
4089-
state_name = replace_indices_in_symbol(state)
4089+
state_name = replace_indices_in_symbol(Symbol(state))
40904090
StatsPlots.savefig(p, save_plots_path * "/" * string(save_plots_name) * "__" * model_name * "__" * state_name * "__" * string(pane) * "." * string(save_plots_format))
40914091
end
40924092
end

0 commit comments

Comments
 (0)