function f = plotwelfcomp_ci(startseries,endseries,spline_step,input_spline_range,...
                          gains_complete,gains_incomplete,gains_autarchy,...
                          legendlist,xlabelline,titleline,axisvec,smoother,style)


spline_range = input_spline_range(startseries):spline_step:input_spline_range(endseries);                      
                 
if smoother == 1
lines = spline_range;
else
lines = input_spline_range(startseries:endseries);
end

if ~isempty(gains_complete)
    input_value_complete = gains_complete(startseries:endseries,1);
    if smoother == 1
    value_complete_0 = spline(input_spline_range(startseries:endseries),input_value_complete,spline_range);
    else
    value_complete_0 = input_value_complete';
    end    
    lines = [lines;value_complete_0];
end    

if ~isempty(gains_incomplete)
    input_value_incomplete = gains_incomplete(startseries:endseries,1);
    if smoother == 1
    value_incomplete_0 = spline(input_spline_range(startseries:endseries),input_value_incomplete,spline_range);
    else
    value_incomplete_0 = input_value_incomplete';
    end    
    lines = [lines;value_incomplete_0];
end    
    
if ~isempty(gains_autarchy)
    input_value_autarchy = gains_autarchy(startseries:endseries,1);
    if smoother == 1
    value_autarchy_0 = spline(input_spline_range(startseries:endseries),input_value_autarchy,spline_range);
    else
    value_autarchy_0 = input_value_autarchy';
    end    
    lines = [lines;value_autarchy_0];
end

n1 = size(lines,1);

for counter = 2:n1
    if counter == 2
        hold on;f=plot(lines(1,:),lines(counter,:),style,'linewidth',2);
    elseif counter == 3
        hold on;plot(lines(1,:),lines(counter,:),'r-','linewidth',2);
    elseif counter == 4
        hold on;plot(lines(1,:),lines(counter,:),'g--','linewidth',2);
    elseif counter == 5
        hold on;plot(lines(1,:),lines(counter,:),'r:','linewidth',2);
    elseif counter == 6
        error('Too many lines');
    end
end
%hold on; plot([0.75,0.75],[0,input_value_incomplete(5-startseries+1,1)],'k--','linewidth',0.6);
%hold on; plot([1.75,1.75],[0,input_value_complete(17-startseries+1,1)],'k--','linewidth',0.6);

hold off
if ~isempty(axisvec)
    xmin = axisvec(1);
    xmax = axisvec(2);
    ymin = axisvec(3);
    ymax = axisvec(4);
    axis([xmin xmax ymin ymax])
end
xlabel(xlabelline);
ylabel('Consumption variation,\newline(relative to cooperation) %');
title(titleline,'Interpreter','none');


                       