figure

subplot(3,1,1);
plot(0:step_count_ssg_1, SSG_1_obj_candidate(1:(step_count_ssg_1+1)), 'blue', ...
     0:step_count_ssg_2, SSG_2_obj_candidate(1:(step_count_ssg_2+1)), 'red', ...
     0:numitersub_ub:step_count_ippssg, IPP_SSG_obj_candidate(1:(ceil(step_count_ippssg/numitersub_ub))+1), 'green', ...
     0:numitersub_ub:step_count_ippconex, IPP_ConEx_obj_candidate(1:(ceil(step_count_ippconex/numitersub_ub))+1), 'yellow')
xlabel('Iteration t')
ylabel('Objective')
legend({'SSG-constant', 'SSG-dynamic', 'IPP-SSG', 'IPP-ConEx'}, 'NumColumns',3)

subplot(3,1,2);
dash_line_length = max(step_count_ssg_1, step_count_ssg_2);
plot(0:step_count_ssg_1, SSG_1_cons_candidate(1:(step_count_ssg_1+1)), 'blue', ...
     0:step_count_ssg_2, SSG_2_cons_candidate(1:(step_count_ssg_2+1)), 'red', ...
     0:numitersub_ub:step_count_ippssg, IPP_SSG_cons_candidate(1:(ceil(step_count_ippssg/numitersub_ub))+1), 'green', ...
     0:numitersub_ub:step_count_ippconex, IPP_ConEx_cons_candidate(1:(ceil(step_count_ippconex/numitersub_ub))+1), 'yellow', ...
     0:dash_line_length, zeros(1, dash_line_length+1), 'black--')
xlabel('Iteration t')
ylabel('Feasibility')
legend({'SSG-constant', 'SSG-dynamic', 'IPP-SSG', 'IPP-ConEx'}, 'NumColumns',3)

subplot(3,1,3);
plot(0:10*numitersub_ub:step_count_ssg_1, SSG_1_stationarity_measure, 'blue', ...
     0:10*numitersub_ub:step_count_ssg_2, SSG_2_stationarity_measure, 'red', ...
     0:10*numitersub_ub:step_count_ippssg, IPP_SSG_stationarity_measure, 'green', ...
     0:10*numitersub_ub:step_count_ippconex, IPP_ConEx_stationarity_measure, 'yellow')
xlabel('Frequency')
ylabel('Stationarity')
legend({'SSG-constant', 'SSG-dynamic', 'IPP-SSG', 'IPP-ConEx'}, 'NumColumns',3)

sgtitle("Convex Constrained Minimization on " + title_name)