I have a problem in plotting togherter the graph of irf after that I did a loop on matlab for changing the value of a variable. I use hold on function but it doesn’t work, I don’t understend why…
I attach here my work on dynare and my matlab loop.

%Plotting every variable in one graph
figure;
var_list_=M_.endo_names;
for j=1:length(var_list_)
subplot(3,2,j);
for i=1:length(phi_i)
plot(results.(sprintf('phi%d',i)).irfs.(sprintf('%s_ea',char(var_list_(j)))));
hold on;
title(sprintf('%s_ea',char(var_list_(j))));
end
legend(strcat('phi = ',string(phi_i)));
hold on;
legend;
end