

FileName = [ModelLabel '_ParametricCurve_id_ap_' num2str(id_paramterer) '.png'];
CompleteFileName = [ './Chap/Opinion_Tools/Figures/' FileName];


if id_model == 1
            % If the  model is Bounded Confidence
            LocalParameters = [55 133 2809 2842 30];
        elseif id_model == 2
            % If the  model is BEBA
            LocalParameters = [30 1268 133 2809 2842];
        elseif id_model == 3
            % If the  model is Classification-based
            LocalParameters = [2382 1633 457 2809];
        elseif id_model == 4
            % If the  model is Friedkin-Johnsen
            LocalParameters = [55 30 2842 2626];
end

ap_text = find(id_paramterer==LocalParameters);
FigureTitle = [ ModelLabel ' AP = ' num2str(ap_text)];

if ~exist(CompleteFileName,'file')        
    if id_model == 3

        InnerFractions = transpose(Original_AgentParameters); 
        IndividualColors = InnerFractions*(1/100);
        ShuffledIndividualColors = [transpose(IndividualColors(2,:)), transpose(IndividualColors(3,:)), transpose(IndividualColors(1,:))];
        ternplot(IndividualColors(1,:), IndividualColors(2,:), IndividualColors(3,:), 'linewidth', 5, 'markersize', 35, 'majors', 10, 'PointColors', ShuffledIndividualColors, 'PointTypes', {'.'}, 'labelsize', 12)
        hold on
        
        ternlabel('\textbf{Agents conformist traits} \boldmath$\alpha_i$', '\textbf{Agents radical traits} \boldmath$\beta_i$', '\textbf{Agents stubborn traits} \boldmath$\gamma_i$', 27, 'normal', 'Interpreter', 'latex', 'FontName', 'Sans Serif')
        title(FigureTitle, 'FontSize', 30)
    else
        
        FancyHistogram(AgentParameters, Color_1, Color_2, linspace(0,max_par_val,11))
        if id_model == 1
            % If the  model is Bounded Confidence
            xlabel('Confidence Radius')
        elseif id_model == 2
            % If the  model is BEBA
            xlabel('Entrenchment')
        elseif id_model == 4
            % If the  model is Friedkin-Johnsen
            xlabel('Susceptibility')
        end
        title(FigureTitle)
        xticks(linspace(0,max_par_val,5))
        yticks(linspace(0,100,5))
        grid on
    end
    
    set(gca, 'fontsize', 31, 'fontweight', 'bold')
    exportgraphics(Fig, CompleteFileName), pause(0.1), clf
end







